pax_global_header00006660000000000000000000000064135577026420014525gustar00rootroot0000000000000052 comment=9df44fa80015114eb03b4e23b4ff551a9eb40e3a cytoolz-0.10.1/000077500000000000000000000000001355770264200133075ustar00rootroot00000000000000cytoolz-0.10.1/.binstar.yml000066400000000000000000000003561355770264200155560ustar00rootroot00000000000000package: cytoolz platform: - linux-64 - linux-32 - osx-64 - win-64 - win-32 engine: - python=2.6 - python=2.7 - python=3.3 - python=3.4 script: - conda build conda.recipe build_targets: files: conda channels: main cytoolz-0.10.1/.gitignore000066400000000000000000000000531355770264200152750ustar00rootroot00000000000000*.html *.pyc *.swp *.so *.pyd build/ dist/ cytoolz-0.10.1/.travis.yml000066400000000000000000000006601355770264200154220ustar00rootroot00000000000000language: python python: - "2.7" - "3.4" - "3.5" - "3.6" - "3.7" - "3.8" before_install: - pip install toolz==0.10.0 - pip install pytest install: - python setup.py build_ext --inplace --without-cython # commands to run tests script: - nosetests --with-doctest cytoolz # For convenience, make sure simple test commands work - py.test - nosetests notifications: email: false cytoolz-0.10.1/AUTHORS.md000066400000000000000000000011731355770264200147600ustar00rootroot00000000000000Erik Welch [@eriknw](https://github.com/eriknw/) [Matthew Rocklin](http://matthewrocklin.com) [@mrocklin](http://github.com/mrocklin/) Lars Buitinck [@larsmans](http://github.com/larsmans) [Thouis (Ray) Jones](http://people.seas.harvard.edu/~thouis) [@thouis](https://github.com/thouis/) scoder [@scoder](https://github.com/scoder/) Phillip Cloud [@cpcloud](https://github.com/cpcloud) Joe Jevnik [@llllllllll](https://github.com/llllllllll) cytoolz-0.10.1/LICENSE.txt000066400000000000000000000027211355770264200151340ustar00rootroot00000000000000Copyright (c) 2014 Erik Welch All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: a. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. b. 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. c. Neither the name of cytoolz nor the names of its 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 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 REGENTS 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. cytoolz-0.10.1/MANIFEST.in000066400000000000000000000000601355770264200150410ustar00rootroot00000000000000include LICENSE.txt include cytoolz/tests/*.py cytoolz-0.10.1/Makefile000066400000000000000000000021601355770264200147460ustar00rootroot00000000000000SHELL= /bin/bash PYTHON ?= python inplace: $(PYTHON) setup.py build_ext --inplace --cython test: inplace nosetests -s --with-doctest cytoolz/ echo 'cimport cytoolz ; from cytoolz.functoolz cimport memoize' > try_cimport_cytoolz.pyx cythonize -i try_cimport_cytoolz.pyx python -c 'import try_cimport_cytoolz' rm try_cimport_cytoolz.* clean: rm -f cytoolz/*.c cytoolz/*.so cytoolz/*/*.c cytoolz/*/*.so rm -rf build/ cytoolz/__pycache__/ cytoolz/*/__pycache__/ curried: sed -e 's/toolz/cytoolz/g' -e 's/itercytoolz/itertoolz/' \ -e 's/dictcytoolz/dicttoolz/g' -e 's/funccytoolz/functoolz/g' \ ../toolz/toolz/curried/__init__.py > cytoolz/curried/__init__.py copytests: for f in ../toolz/toolz/tests/test*py; \ do \ if [[ $$f == *test_utils* ]]; then continue ; fi; \ if [[ $$f == *test_curried_doctests* ]]; then continue ; fi; \ if [[ $$f == *test_tlz* ]]; then continue ; fi; \ newf=`echo $$f | sed 's/...toolz.toolz/cytoolz/g'`; \ sed -e 's/toolz/cytoolz/g' -e 's/itercytoolz/itertoolz/' \ -e 's/dictcytoolz/dicttoolz/g' -e 's/funccytoolz/functoolz/g' \ $$f > $$newf; \ echo $$f $$newf; \ done cytoolz-0.10.1/README.rst000066400000000000000000000052421355770264200150010ustar00rootroot00000000000000CyToolz ======= |Build Status| |Version Status| Cython implementation of the |literal toolz|_ `package, `__ which provides high performance utility functions for iterables, functions, and dictionaries. .. |literal toolz| replace:: ``toolz`` .. _literal toolz: https://github.com/pytoolz/toolz ``toolz`` is a pure Python package that borrows heavily from contemporary functional languanges. It is designed to interoperate seamlessly with other libraries including ``itertools``, ``functools``, and third party libraries. High performance functional data analysis is possible with builtin types like ``list`` and ``dict``, and user-defined data structures; and low memory usage is achieved by using the iterator protocol and returning iterators whenever possible. ``cytoolz`` implements the same API as ``toolz``. The main differences are that ``cytoolz`` is faster (typically 2-5x faster with a few spectacular exceptions) and ``cytoolz`` offers a C API that is accessible to other projects developed in Cython. Since ``toolz`` is able to process very large (potentially infinite) data sets, the performance increase gained by using ``cytoolz`` can be significant. See the PyToolz documentation at https://toolz.readthedocs.io and the full `API Documentation `__ for more details. LICENSE ------- New BSD. See `License File `__. Install ------- ``cytoolz`` is on the Python Package Index (PyPI): :: pip install cytoolz Dependencies ------------ ``cytoolz`` supports Python 2.7+ and Python 3.4+ with a common codebase. It is developed in Cython, but requires no dependecies other than CPython and a C compiler. Like ``toolz``, it is a light weight dependency. Contributions Welcome --------------------- ``toolz`` (and ``cytoolz``) aims to be a repository for utility functions, particularly those that come from the functional programming and list processing traditions. We welcome contributions that fall within this scope and encourage users to scrape their ``util.py`` files for functions that are broadly useful. Please take a look at our issue pages for `toolz `__ and `cytoolz `__ for contribution ideas. Community --------- See our `mailing list `__. We're friendly. .. |Build Status| image:: https://travis-ci.org/pytoolz/cytoolz.svg?branch=master :target: https://travis-ci.org/pytoolz/cytoolz .. |Version Status| image:: https://badge.fury.io/py/cytoolz.svg :target: http://badge.fury.io/py/cytoolz cytoolz-0.10.1/conda.recipe/000077500000000000000000000000001355770264200156415ustar00rootroot00000000000000cytoolz-0.10.1/conda.recipe/bld.bat000066400000000000000000000000551355770264200170720ustar00rootroot00000000000000cd %RECIPE_DIR%\.. %PYTHON% setup.py install cytoolz-0.10.1/conda.recipe/build.sh000077500000000000000000000000531355770264200172750ustar00rootroot00000000000000cd $RECIPE_DIR/.. $PYTHON setup.py install cytoolz-0.10.1/conda.recipe/meta.yaml000066400000000000000000000010421355770264200174500ustar00rootroot00000000000000package: name: cytoolz version: "0.10.1" build: number: {{environ.get('BINSTAR_BUILD', 1)}} requirements: build: - setuptools - python - cython - toolz - libpython # [win and not (win64 and py34)] run: - python - libpython # [win and not (win64 and py34)] test: requires: - pytest - nose - toolz imports: - cytoolz commands: - py.test -x --doctest-modules --pyargs cytoolz about: home: https://toolz.readthedocs.io/ license: BSD cytoolz-0.10.1/cytoolz/000077500000000000000000000000001355770264200150125ustar00rootroot00000000000000cytoolz-0.10.1/cytoolz/__init__.pxd000066400000000000000000000013561355770264200172730ustar00rootroot00000000000000from cytoolz.itertoolz cimport ( accumulate, c_merge_sorted, cons, count, drop, get, groupby, first, frequencies, interleave, interpose, isdistinct, isiterable, iterate, last, mapcat, nth, partition, partition_all, pluck, reduceby, remove, rest, second, sliding_window, take, tail, take_nth, unique, join, c_diff, topk, peek, random_sample, concat) from cytoolz.functoolz cimport ( c_compose, c_juxt, memoize, c_pipe, c_thread_first, c_thread_last, complement, curry, do, identity, excepts, flip) from cytoolz.dicttoolz cimport ( assoc, c_merge, c_merge_with, c_dissoc, get_in, keyfilter, keymap, itemfilter, itemmap, update_in, valfilter, valmap, assoc_in) from cytoolz.recipes cimport countby, partitionby cytoolz-0.10.1/cytoolz/__init__.py000066400000000000000000000007451355770264200171310ustar00rootroot00000000000000from .itertoolz import * from .functoolz import * from .dicttoolz import * from .recipes import * from .compatibility import map, filter from functools import partial, reduce sorted = sorted # Aliases comp = compose # Always-curried functions flip = functoolz.flip = curry(functoolz.flip) memoize = functoolz.memoize = curry(functoolz.memoize) from . import curried # sandbox functoolz._sigs.update_signature_registry() from ._version import __version__, __toolz_version__ cytoolz-0.10.1/cytoolz/_signatures.py000066400000000000000000000104041355770264200177060ustar00rootroot00000000000000from toolz._signatures import * from toolz._signatures import (_is_arity, _has_varargs, _has_keywords, _num_required_args, _is_partial_args, _is_valid_args) cytoolz_info = {} cytoolz_info['cytoolz.dicttoolz'] = dict( assoc=[ lambda d, key, value, factory=dict: None], assoc_in=[ lambda d, keys, value, factory=dict: None], dissoc=[ lambda d, *keys, **kwargs: None], get_in=[ lambda keys, coll, default=None, no_default=False: None], itemfilter=[ lambda predicate, d, factory=dict: None], itemmap=[ lambda func, d, factory=dict: None], keyfilter=[ lambda predicate, d, factory=dict: None], keymap=[ lambda func, d, factory=dict: None], merge=[ lambda *dicts, **kwargs: None], merge_with=[ lambda func, *dicts, **kwargs: None], update_in=[ lambda d, keys, func, default=None, factory=dict: None], valfilter=[ lambda predicate, d, factory=dict: None], valmap=[ lambda func, d, factory=dict: None], ) cytoolz_info['cytoolz.functoolz'] = dict( apply=[ lambda *func_and_args, **kwargs: None], Compose=[ lambda *funcs: None], complement=[ lambda func: None], compose=[ lambda *funcs: None], compose_left=[ lambda *funcs: None], curry=[ lambda *args, **kwargs: None], do=[ lambda func, x: None], excepts=[ lambda exc, func, handler=None: None], flip=[ lambda: None, lambda func: None, lambda func, a: None, lambda func, a, b: None], _flip=[ lambda func, a, b: None], identity=[ lambda x: None], juxt=[ lambda *funcs: None], memoize=[ lambda cache=None, key=None: None, lambda func, cache=None, key=None: None], _memoize=[ lambda func, cache=None, key=None: None], pipe=[ lambda data, *funcs: None], return_none=[ lambda exc: None], thread_first=[ lambda val, *forms: None], thread_last=[ lambda val, *forms: None], ) cytoolz_info['cytoolz.itertoolz'] = dict( accumulate=[ lambda binop, seq, initial='__no__default__': None], concat=[ lambda seqs: None], concatv=[ lambda *seqs: None], cons=[ lambda el, seq: None], count=[ lambda seq: None], diff=[ lambda *seqs, **kwargs: None], drop=[ lambda n, seq: None], first=[ lambda seq: None], frequencies=[ lambda seq: None], get=[ lambda ind, seq, default=None: None], getter=[ lambda index: None], groupby=[ lambda key, seq: None], identity=[ lambda x: None], interleave=[ lambda seqs: None], interpose=[ lambda el, seq: None], isdistinct=[ lambda seq: None], isiterable=[ lambda x: None], iterate=[ lambda func, x: None], join=[ lambda leftkey, leftseq, rightkey, rightseq, left_default=None, right_default=None: None], last=[ lambda seq: None], mapcat=[ lambda func, seqs: None], merge_sorted=[ lambda *seqs, **kwargs: None], nth=[ lambda n, seq: None], partition=[ lambda n, seq, pad=None: None], partition_all=[ lambda n, seq: None], peek=[ lambda seq: None], peekn=[ lambda n, seq: None], pluck=[ lambda ind, seqs, default=None: None], random_sample=[ lambda prob, seq, random_state=None: None], reduceby=[ lambda key, binop, seq, init=None: None], remove=[ lambda predicate, seq: None], rest=[ lambda seq: None], second=[ lambda seq: None], sliding_window=[ lambda n, seq: None], tail=[ lambda n, seq: None], take=[ lambda n, seq: None], take_nth=[ lambda n, seq: None], topk=[ lambda k, seq, key=None: None], unique=[ lambda seq, key=None: None], ) cytoolz_info['cytoolz.recipes'] = dict( countby=[ lambda key, seq: None], partitionby=[ lambda func, seq: None], ) def update_signature_registry(): create_signature_registry(cytoolz_info) module_info.update(cytoolz_info) cytoolz-0.10.1/cytoolz/_version.py000066400000000000000000000000641355770264200172100ustar00rootroot00000000000000__version__ = '0.10.1' __toolz_version__ = '0.10.0' cytoolz-0.10.1/cytoolz/compatibility.py000066400000000000000000000020621355770264200202350ustar00rootroot00000000000000import operator import sys PY3 = sys.version_info[0] > 2 PY34 = sys.version_info[0] == 3 and sys.version_info[1] == 4 __all__ = ['PY3', 'map', 'filter', 'range', 'zip', 'reduce', 'zip_longest', 'iteritems', 'iterkeys', 'itervalues', 'import_module'] if PY3: map = map filter = filter range = range zip = zip from functools import reduce from itertools import zip_longest iteritems = operator.methodcaller('items') iterkeys = operator.methodcaller('keys') itervalues = operator.methodcaller('values') else: range = xrange reduce = reduce from itertools import imap as map from itertools import ifilter as filter from itertools import izip as zip from itertools import izip_longest as zip_longest iteritems = operator.methodcaller('iteritems') iterkeys = operator.methodcaller('iterkeys') itervalues = operator.methodcaller('itervalues') try: from importlib import import_module except ImportError: def import_module(name): __import__(name) return sys.modules[name] cytoolz-0.10.1/cytoolz/cpython.pxd000066400000000000000000000007611355770264200172170ustar00rootroot00000000000000""" Additional bindings to Python's C-API. These differ from Cython's bindings in ``cpython``. """ from cpython.ref cimport PyObject cdef extern from "Python.h": PyObject* PtrIter_Next "PyIter_Next"(object o) PyObject* PtrObject_Call "PyObject_Call"(object callable_object, object args, object kw) PyObject* PtrObject_GetItem "PyObject_GetItem"(object o, object key) int PyDict_Next_Compat "PyDict_Next"(object p, Py_ssize_t *ppos, PyObject* *pkey, PyObject* *pvalue) except -1 cytoolz-0.10.1/cytoolz/curried/000077500000000000000000000000001355770264200164475ustar00rootroot00000000000000cytoolz-0.10.1/cytoolz/curried/__init__.py000066400000000000000000000055041355770264200205640ustar00rootroot00000000000000""" Alternate namespace for cytoolz such that all functions are curried Currying provides implicit partial evaluation of all functions Example: Get usually requires two arguments, an index and a collection >>> from cytoolz.curried import get >>> get(0, ('a', 'b')) 'a' When we use it in higher order functions we often want to pass a partially evaluated form >>> data = [(1, 2), (11, 22), (111, 222)] >>> list(map(lambda seq: get(0, seq), data)) [1, 11, 111] The curried version allows simple expression of partial evaluation >>> list(map(get(0), data)) [1, 11, 111] See Also: cytoolz.functoolz.curry """ import cytoolz from . import operator from cytoolz import ( apply, comp, complement, compose, compose_left, concat, concatv, count, curry, diff, first, flip, frequencies, identity, interleave, isdistinct, isiterable, juxt, last, memoize, merge_sorted, peek, pipe, second, thread_first, thread_last, ) from .exceptions import merge, merge_with accumulate = cytoolz.curry(cytoolz.accumulate) assoc = cytoolz.curry(cytoolz.assoc) assoc_in = cytoolz.curry(cytoolz.assoc_in) cons = cytoolz.curry(cytoolz.cons) countby = cytoolz.curry(cytoolz.countby) dissoc = cytoolz.curry(cytoolz.dissoc) do = cytoolz.curry(cytoolz.do) drop = cytoolz.curry(cytoolz.drop) excepts = cytoolz.curry(cytoolz.excepts) filter = cytoolz.curry(cytoolz.filter) get = cytoolz.curry(cytoolz.get) get_in = cytoolz.curry(cytoolz.get_in) groupby = cytoolz.curry(cytoolz.groupby) interpose = cytoolz.curry(cytoolz.interpose) itemfilter = cytoolz.curry(cytoolz.itemfilter) itemmap = cytoolz.curry(cytoolz.itemmap) iterate = cytoolz.curry(cytoolz.iterate) join = cytoolz.curry(cytoolz.join) keyfilter = cytoolz.curry(cytoolz.keyfilter) keymap = cytoolz.curry(cytoolz.keymap) map = cytoolz.curry(cytoolz.map) mapcat = cytoolz.curry(cytoolz.mapcat) nth = cytoolz.curry(cytoolz.nth) partial = cytoolz.curry(cytoolz.partial) partition = cytoolz.curry(cytoolz.partition) partition_all = cytoolz.curry(cytoolz.partition_all) partitionby = cytoolz.curry(cytoolz.partitionby) peekn = cytoolz.curry(cytoolz.peekn) pluck = cytoolz.curry(cytoolz.pluck) random_sample = cytoolz.curry(cytoolz.random_sample) reduce = cytoolz.curry(cytoolz.reduce) reduceby = cytoolz.curry(cytoolz.reduceby) remove = cytoolz.curry(cytoolz.remove) sliding_window = cytoolz.curry(cytoolz.sliding_window) sorted = cytoolz.curry(cytoolz.sorted) tail = cytoolz.curry(cytoolz.tail) take = cytoolz.curry(cytoolz.take) take_nth = cytoolz.curry(cytoolz.take_nth) topk = cytoolz.curry(cytoolz.topk) unique = cytoolz.curry(cytoolz.unique) update_in = cytoolz.curry(cytoolz.update_in) valfilter = cytoolz.curry(cytoolz.valfilter) valmap = cytoolz.curry(cytoolz.valmap) del exceptions del cytoolz cytoolz-0.10.1/cytoolz/curried/exceptions.py000066400000000000000000000005361355770264200212060ustar00rootroot00000000000000import cytoolz __all__ = ['merge', 'merge_with'] @cytoolz.curry def merge(d, *dicts, **kwargs): return cytoolz.merge(d, *dicts, **kwargs) @cytoolz.curry def merge_with(func, d, *dicts, **kwargs): return cytoolz.merge_with(func, d, *dicts, **kwargs) merge.__doc__ = cytoolz.merge.__doc__ merge_with.__doc__ = cytoolz.merge_with.__doc__ cytoolz-0.10.1/cytoolz/curried/operator.py000066400000000000000000000007661355770264200206650ustar00rootroot00000000000000from __future__ import absolute_import import operator from cytoolz.functoolz import curry, num_required_args, has_keywords def should_curry(f): num = num_required_args(f) return num is None or num > 1 or num == 1 and has_keywords(f) is not False locals().update( dict((name, curry(f) if should_curry(f) else f) for name, f in vars(operator).items() if callable(f)), ) # Clean up the namespace. del curry del num_required_args del has_keywords del operator del should_curry cytoolz-0.10.1/cytoolz/dicttoolz.c000066400000000000000000016655131355770264200172120ustar00rootroot00000000000000/* Generated by Cython 0.29.14 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [], "name": "cytoolz.dicttoolz", "sources": [ "cytoolz/dicttoolz.pyx" ] }, "module_name": "cytoolz.dicttoolz" } END: Cython Metadata */ #define PY_SSIZE_T_CLEAN #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 < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else #define CYTHON_ABI "0_29_14" #define CYTHON_HEX_VERSION 0x001D0EF0 #define CYTHON_FUTURE_DIVISION 0 #include #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 #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x02070000 #define HAVE_LONG_LONG #endif #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_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) #endif #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } # else # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int32 uint32_t; #endif #endif #else #include #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) && __cplusplus >= 201103L #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #elif __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__ ) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #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" #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #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) #endif #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_FAST_PYCCALL #define __Pyx_PyFastCFunction_Check(func)\ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 #define PyMem_RawMalloc(n) PyMem_Malloc(n) #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) #define PyMem_RawFree(p) PyMem_Free(p) #endif #if CYTHON_COMPILING_IN_PYSTON #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #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 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) #else #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) #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_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #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) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #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_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) #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])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if 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 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #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 #define PyObject_Unicode PyObject_Str #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_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #else #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #endif #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_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #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 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { \ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ } #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__cytoolz__dicttoolz #define __PYX_HAVE_API__cytoolz__dicttoolz /* Early includes */ #include #include #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const 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_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) 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); } #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_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_ASSUME_SAFE_MACROS #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 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(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*) "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) + 1); 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 CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_cython_runtime = NULL; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; 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[] = { "cytoolz/dicttoolz.pyx", "stringsource", "type.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping; struct __pyx_opt_args_7cytoolz_9dicttoolz_c_merge; struct __pyx_opt_args_7cytoolz_9dicttoolz_c_merge_with; struct __pyx_opt_args_7cytoolz_9dicttoolz_valmap; struct __pyx_opt_args_7cytoolz_9dicttoolz_keymap; struct __pyx_opt_args_7cytoolz_9dicttoolz_itemmap; struct __pyx_opt_args_7cytoolz_9dicttoolz_valfilter; struct __pyx_opt_args_7cytoolz_9dicttoolz_keyfilter; struct __pyx_opt_args_7cytoolz_9dicttoolz_itemfilter; struct __pyx_opt_args_7cytoolz_9dicttoolz_assoc; struct __pyx_opt_args_7cytoolz_9dicttoolz_assoc_in; struct __pyx_opt_args_7cytoolz_9dicttoolz_c_dissoc; struct __pyx_opt_args_7cytoolz_9dicttoolz_update_in; struct __pyx_opt_args_7cytoolz_9dicttoolz_get_in; /* "cytoolz/dicttoolz.pxd":8 * cdef object cur * * ctypedef int (*f_map_next)(object p, Py_ssize_t *ppos, PyObject* *pkey, PyObject* *pval) except -1 # <<<<<<<<<<<<<< * * cdef f_map_next get_map_iter(object d, PyObject* *ptr) except NULL */ typedef int (*__pyx_t_7cytoolz_9dicttoolz_f_map_next)(PyObject *, Py_ssize_t *, PyObject **, PyObject **); /* "cytoolz/dicttoolz.pxd":15 * * * cdef object c_merge(object dicts, object factory=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9dicttoolz_c_merge { int __pyx_n; PyObject *factory; }; /* "cytoolz/dicttoolz.pxd":18 * * * cdef object c_merge_with(object func, object dicts, object factory=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9dicttoolz_c_merge_with { int __pyx_n; PyObject *factory; }; /* "cytoolz/dicttoolz.pxd":21 * * * cpdef object valmap(object func, object d, object factory=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9dicttoolz_valmap { int __pyx_n; PyObject *factory; }; /* "cytoolz/dicttoolz.pxd":24 * * * cpdef object keymap(object func, object d, object factory=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9dicttoolz_keymap { int __pyx_n; PyObject *factory; }; /* "cytoolz/dicttoolz.pxd":27 * * * cpdef object itemmap(object func, object d, object factory=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9dicttoolz_itemmap { int __pyx_n; PyObject *factory; }; /* "cytoolz/dicttoolz.pxd":30 * * * cpdef object valfilter(object predicate, object d, object factory=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9dicttoolz_valfilter { int __pyx_n; PyObject *factory; }; /* "cytoolz/dicttoolz.pxd":33 * * * cpdef object keyfilter(object predicate, object d, object factory=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9dicttoolz_keyfilter { int __pyx_n; PyObject *factory; }; /* "cytoolz/dicttoolz.pxd":36 * * * cpdef object itemfilter(object predicate, object d, object factory=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9dicttoolz_itemfilter { int __pyx_n; PyObject *factory; }; /* "cytoolz/dicttoolz.pxd":39 * * * cpdef object assoc(object d, object key, object value, object factory=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9dicttoolz_assoc { int __pyx_n; PyObject *factory; }; /* "cytoolz/dicttoolz.pxd":42 * * * cpdef object assoc_in(object d, object keys, object value, object factory=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9dicttoolz_assoc_in { int __pyx_n; PyObject *factory; }; /* "cytoolz/dicttoolz.pxd":45 * * * cdef object c_dissoc(object d, object keys, object factory=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9dicttoolz_c_dissoc { int __pyx_n; PyObject *factory; }; /* "cytoolz/dicttoolz.pxd":48 * * * cpdef object update_in(object d, object keys, object func, object default=*, object factory=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9dicttoolz_update_in { int __pyx_n; PyObject *__pyx_default; PyObject *factory; }; /* "cytoolz/dicttoolz.pxd":51 * * * cpdef object get_in(object keys, object coll, object default=*, object no_default=*) # <<<<<<<<<<<<<< */ struct __pyx_opt_args_7cytoolz_9dicttoolz_get_in { int __pyx_n; PyObject *__pyx_default; PyObject *no_default; }; /* "cytoolz/dicttoolz.pxd":4 * * # utility functions to perform iteration over dicts or generic mapping * cdef class _iter_mapping: # <<<<<<<<<<<<<< * cdef object it * cdef object cur */ struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping { PyObject_HEAD PyObject *it; PyObject *cur; }; /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #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); #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 #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) /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* IterNext.proto */ #define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL) static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *); /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* GetItemInt.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 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); /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* HasAttr.proto */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectCallNoArg.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif /* PyCFunctionFastCall.proto */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); #else #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* PyObjectCall2Args.proto */ static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* UnpackUnboundCMethod.proto */ typedef struct { PyObject *type; PyObject **method_name; PyCFunction func; PyObject *method; int flag; } __Pyx_CachedCFunction; /* CallUnboundCMethod1.proto */ static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #else #define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) #endif /* set_iter.proto */ static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set, Py_ssize_t* p_orig_length, int* p_source_is_set); static CYTHON_INLINE int __Pyx_set_iter_next( PyObject* iter_obj, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject **value, int source_is_set); /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ static int __Pyx_setup_reduce(PyObject* type_obj); /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto #define __PYX_HAVE_RT_ImportType_proto enum __Pyx_ImportType_CheckSize { __Pyx_ImportType_CheckSize_Error = 0, __Pyx_ImportType_CheckSize_Warn = 1, __Pyx_ImportType_CheckSize_Ignore = 2 }; static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); #endif /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* FetchCommonType.proto */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); /* CythonFunction.proto */ #define __Pyx_CyFunction_USED 1 #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; #if PY_VERSION_HEX < 0x030500A0 PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; void *defaults; int defaults_pyobjects; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) #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); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; int code_line; } __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); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.type' */ static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; /* Module declarations from 'cpython' */ /* Module declarations from 'cpython.object' */ /* Module declarations from 'cpython.ref' */ /* Module declarations from 'cpython.dict' */ /* Module declarations from 'cpython.list' */ /* Module declarations from 'cytoolz.cpython' */ /* Module declarations from 'cytoolz.dicttoolz' */ static PyTypeObject *__pyx_ptype_7cytoolz_9dicttoolz__iter_mapping = 0; static PyObject *__pyx_v_7cytoolz_9dicttoolz__get_in_exceptions = 0; static __pyx_t_7cytoolz_9dicttoolz_f_map_next __pyx_f_7cytoolz_9dicttoolz_get_map_iter(PyObject *, PyObject **); /*proto*/ static int __pyx_f_7cytoolz_9dicttoolz_PyMapping_Next(PyObject *, Py_ssize_t *, PyObject **, PyObject **); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_c_merge(PyObject *, struct __pyx_opt_args_7cytoolz_9dicttoolz_c_merge *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_c_merge_with(PyObject *, PyObject *, struct __pyx_opt_args_7cytoolz_9dicttoolz_c_merge_with *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_valmap(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_valmap *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_keymap(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_keymap *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_itemmap(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_itemmap *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_valfilter(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_valfilter *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_keyfilter(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_keyfilter *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_itemfilter(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_itemfilter *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_assoc(PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_assoc *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_assoc_in(PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_assoc_in *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_c_dissoc(PyObject *, PyObject *, struct __pyx_opt_args_7cytoolz_9dicttoolz_c_dissoc *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_update_in(PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_update_in *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_get_in(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_get_in *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_get_factory(PyObject *, PyObject *); /*proto*/ #define __Pyx_MODULE_NAME "cytoolz.dicttoolz" extern int __pyx_module_is_main_cytoolz__dicttoolz; int __pyx_module_is_main_cytoolz__dicttoolz = 0; /* Implementation of 'cytoolz.dicttoolz' */ static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_TypeError; static const char __pyx_k_d[] = "d"; static const char __pyx_k_it[] = "it"; static const char __pyx_k_all[] = "__all__"; static const char __pyx_k_key[] = "key"; static const char __pyx_k_pop[] = "pop"; static const char __pyx_k_coll[] = "coll"; static const char __pyx_k_copy[] = "copy"; static const char __pyx_k_func[] = "func"; static const char __pyx_k_keys[] = "keys"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_assoc[] = "assoc"; static const char __pyx_k_dicts[] = "dicts"; static const char __pyx_k_items[] = "items"; static const char __pyx_k_merge[] = "merge"; static const char __pyx_k_value[] = "value"; static const char __pyx_k_dissoc[] = "dissoc"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_get_in[] = "get_in"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_keymap[] = "keymap"; static const char __pyx_k_kwargs[] = "kwargs"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_valmap[] = "valmap"; static const char __pyx_k_default[] = "default"; static const char __pyx_k_factory[] = "factory"; static const char __pyx_k_itemmap[] = "itemmap"; static const char __pyx_k_popitem[] = "popitem"; static const char __pyx_k_KeyError[] = "KeyError"; static const char __pyx_k_assoc_in[] = "assoc_in"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_iteritems[] = "iteritems"; static const char __pyx_k_keyfilter[] = "keyfilter"; static const char __pyx_k_predicate[] = "predicate"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_update_in[] = "update_in"; static const char __pyx_k_valfilter[] = "valfilter"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_itemfilter[] = "itemfilter"; static const char __pyx_k_merge_with[] = "merge_with"; static const char __pyx_k_no_default[] = "no_default"; static const char __pyx_k_iter_mapping[] = "_iter_mapping"; static const char __pyx_k_stringsource[] = "stringsource"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_assoc_line_368[] = "assoc (line 368)"; static const char __pyx_k_merge_line_100[] = "merge (line 100)"; static const char __pyx_k_dissoc_line_448[] = "dissoc (line 448)"; static const char __pyx_k_get_in_line_536[] = "get_in (line 536)"; static const char __pyx_k_keymap_line_208[] = "keymap (line 208)"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_valmap_line_179[] = "valmap (line 179)"; static const char __pyx_k_itemmap_line_237[] = "itemmap (line 237)"; static const char __pyx_k_assoc_in_line_389[] = "assoc_in (line 389)"; static const char __pyx_k_cytoolz_dicttoolz[] = "cytoolz.dicttoolz"; static const char __pyx_k_difference_update[] = "difference_update"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_keyfilter_line_299[] = "keyfilter (line 299)"; static const char __pyx_k_update_in_line_465[] = "update_in (line 465)"; static const char __pyx_k_valfilter_line_267[] = "valfilter (line 267)"; static const char __pyx_k_itemfilter_line_331[] = "itemfilter (line 331)"; static const char __pyx_k_merge_with_line_157[] = "merge_with (line 157)"; static const char __pyx_k_cytoolz_dicttoolz_pyx[] = "cytoolz/dicttoolz.pyx"; static const char __pyx_k_iter_mapping___reduce_cython[] = "_iter_mapping.__reduce_cython__"; static const char __pyx_k_Return_a_new_dict_with_new_key[] = "\n Return a new dict with new key value pair\n\n New dict has d[key] set to value. Does not modify the initial dictionary.\n\n >>> assoc({'x': 1}, 'x', 2)\n {'x': 2}\n >>> assoc({'x': 1}, 'y', 3) # doctest: +SKIP\n {'x': 1, 'y': 3}\n "; static const char __pyx_k_Returns_coll_i0_i1_iX_where_i0[] = "\n Returns coll[i0][i1]...[iX] where [i0, i1, ..., iX]==keys.\n\n If coll[i0][i1]...[iX] cannot be found, returns ``default``, unless\n ``no_default`` is specified, then it raises KeyError or IndexError.\n\n ``get_in`` is a generalization of ``operator.getitem`` for nested data\n structures such as dictionaries and lists.\n\n >>> transaction = {'name': 'Alice',\n ... 'purchase': {'items': ['Apple', 'Orange'],\n ... 'costs': [0.50, 1.25]},\n ... 'credit card': '5555-1234-1234-1234'}\n >>> get_in(['purchase', 'items', 0], transaction)\n 'Apple'\n >>> get_in(['name'], transaction)\n 'Alice'\n >>> get_in(['purchase', 'total'], transaction)\n >>> get_in(['purchase', 'items', 'apple'], transaction)\n >>> get_in(['purchase', 'items', 10], transaction)\n >>> get_in(['purchase', 'total'], transaction, 0)\n 0\n >>> get_in(['y'], {}, no_default=True)\n Traceback (most recent call last):\n ...\n KeyError: 'y'\n\n See Also:\n itertoolz.get\n operator.getitem\n "; static const char __pyx_k_iter_mapping___setstate_cython[] = "_iter_mapping.__setstate_cython__"; static const char __pyx_k_0_got_an_unexpected_keyword_arg[] = "{0}() got an unexpected keyword argument '{1}'"; static const char __pyx_k_Apply_function_to_items_of_dict[] = "\n Apply function to items of dictionary\n\n >>> accountids = {\"Alice\": 10, \"Bob\": 20}\n >>> itemmap(reversed, accountids) # doctest: +SKIP\n {10: \"Alice\", 20: \"Bob\"}\n\n See Also:\n keymap\n valmap\n "; static const char __pyx_k_Apply_function_to_keys_of_dicti[] = "\n Apply function to keys of dictionary\n\n >>> bills = {\"Alice\": [20, 15, 30], \"Bob\": [10, 35]}\n >>> keymap(str.lower, bills) # doctest: +SKIP\n {'alice': [20, 15, 30], 'bob': [10, 35]}\n\n See Also:\n valmap\n itemmap\n "; static const char __pyx_k_Apply_function_to_values_of_dic[] = "\n Apply function to values of dictionary\n\n >>> bills = {\"Alice\": [20, 15, 30], \"Bob\": [10, 35]}\n >>> valmap(sum, bills) # doctest: +SKIP\n {'Alice': 65, 'Bob': 45}\n\n See Also:\n keymap\n itemmap\n "; static const char __pyx_k_Filter_items_in_dictionary_by_i[] = "\n Filter items in dictionary by item\n\n >>> def isvalid(item):\n ... k, v = item\n ... return k % 2 == 0 and v < 4\n\n >>> d = {1: 2, 2: 3, 3: 4, 4: 5}\n >>> itemfilter(isvalid, d)\n {2: 3}\n\n See Also:\n keyfilter\n valfilter\n itemmap\n "; static const char __pyx_k_Filter_items_in_dictionary_by_k[] = "\n Filter items in dictionary by key\n\n >>> iseven = lambda x: x % 2 == 0\n >>> d = {1: 2, 2: 3, 3: 4, 4: 5}\n >>> keyfilter(iseven, d)\n {2: 3, 4: 5}\n\n See Also:\n valfilter\n itemfilter\n keymap\n "; static const char __pyx_k_Filter_items_in_dictionary_by_v[] = "\n Filter items in dictionary by value\n\n >>> iseven = lambda x: x % 2 == 0\n >>> d = {1: 2, 2: 3, 3: 4, 4: 5}\n >>> valfilter(iseven, d)\n {1: 2, 3: 4}\n\n See Also:\n keyfilter\n itemfilter\n valmap\n "; static const char __pyx_k_Merge_a_collection_of_dictionar[] = "\n Merge a collection of dictionaries\n\n >>> merge({1: 'one'}, {2: 'two'})\n {1: 'one', 2: 'two'}\n\n Later dictionaries have precedence\n\n >>> merge({1: 2, 3: 4}, {3: 3, 4: 4})\n {1: 2, 3: 3, 4: 4}\n\n See Also:\n merge_with\n "; static const char __pyx_k_Merge_dictionaries_and_apply_fu[] = "\n Merge dictionaries and apply function to combined values\n\n A key may occur in more than one dict, and all values mapped from the key\n will be passed to the function as a list, such as func([val1, val2, ...]).\n\n >>> merge_with(sum, {1: 1, 2: 2}, {1: 10, 2: 20})\n {1: 11, 2: 22}\n\n >>> merge_with(first, {1: 1, 2: 2}, {2: 20, 3: 30}) # doctest: +SKIP\n {1: 1, 2: 2, 3: 30}\n\n See Also:\n merge\n "; static const char __pyx_k_Return_a_new_dict_with_new_pote[] = "\n Return a new dict with new, potentially nested, key value pair\n\n >>> purchase = {'name': 'Alice',\n ... 'order': {'items': ['Apple', 'Orange'],\n ... 'costs': [0.50, 1.25]},\n ... 'credit card': '5555-1234-1234-1234'}\n >>> assoc_in(purchase, ['order', 'costs'], [0.25, 1.00]) # doctest: +SKIP\n {'credit card': '5555-1234-1234-1234',\n 'name': 'Alice',\n 'order': {'costs': [0.25, 1.00], 'items': ['Apple', 'Orange']}}\n "; static const char __pyx_k_Return_a_new_dict_with_the_give[] = "\n Return a new dict with the given key(s) removed.\n\n New dict has d[key] deleted for each supplied key.\n Does not modify the initial dictionary.\n\n >>> dissoc({'x': 1, 'y': 2}, 'y')\n {'x': 1}\n >>> dissoc({'x': 1, 'y': 2}, 'y', 'x')\n {}\n >>> dissoc({'x': 1}, 'y') # Ignores missing keys\n {'x': 1}\n "; static const char __pyx_k_Update_value_in_a_potentially_n[] = "\n Update value in a (potentially) nested dictionary\n\n inputs:\n d - dictionary on which to operate\n keys - list or tuple giving the location of the value to be changed in d\n func - function to operate on that value\n\n If keys == [k0,..,kX] and d[k0]..[kX] == v, update_in returns a copy of the\n original dictionary with v replaced by func(v), but does not mutate the\n original dictionary.\n\n If k0 is not a key in d, update_in creates nested dictionaries to the depth\n specified by the keys, with the innermost value set to func(default).\n\n >>> inc = lambda x: x + 1\n >>> update_in({'a': 0}, ['a'], inc)\n {'a': 1}\n\n >>> transaction = {'name': 'Alice',\n ... 'purchase': {'items': ['Apple', 'Orange'],\n ... 'costs': [0.50, 1.25]},\n ... 'credit card': '5555-1234-1234-1234'}\n >>> update_in(transaction, ['purchase', 'costs'], sum) # doctest: +SKIP\n {'credit card': '5555-1234-1234-1234',\n 'name': 'Alice',\n 'purchase': {'costs': 1.75, 'items': ['Apple', 'Orange']}}\n\n >>> # updating a value when k0 is not in d\n >>> update_in({}, [1, 2, 3], str, default=\"bar\")\n {1: {2: {3: 'bar'}}}\n >>> update_in({1: 'foo'}, [2, 3, 4], inc, 0)\n {1: 'foo', 2: {3: {4: 1}}}\n "; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; static PyObject *__pyx_kp_s_0_got_an_unexpected_keyword_arg; static PyObject *__pyx_kp_u_Apply_function_to_items_of_dict; static PyObject *__pyx_kp_u_Apply_function_to_keys_of_dicti; static PyObject *__pyx_kp_u_Apply_function_to_values_of_dic; static PyObject *__pyx_kp_u_Filter_items_in_dictionary_by_i; static PyObject *__pyx_kp_u_Filter_items_in_dictionary_by_k; static PyObject *__pyx_kp_u_Filter_items_in_dictionary_by_v; static PyObject *__pyx_n_s_IndexError; static PyObject *__pyx_n_s_KeyError; static PyObject *__pyx_kp_u_Merge_a_collection_of_dictionar; static PyObject *__pyx_kp_u_Merge_dictionaries_and_apply_fu; static PyObject *__pyx_kp_u_Return_a_new_dict_with_new_key; static PyObject *__pyx_kp_u_Return_a_new_dict_with_new_pote; static PyObject *__pyx_kp_u_Return_a_new_dict_with_the_give; static PyObject *__pyx_kp_u_Returns_coll_i0_i1_iX_where_i0; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_kp_u_Update_value_in_a_potentially_n; static PyObject *__pyx_n_s_all; static PyObject *__pyx_n_s_assoc; static PyObject *__pyx_n_s_assoc_in; static PyObject *__pyx_kp_u_assoc_in_line_389; static PyObject *__pyx_kp_u_assoc_line_368; static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_coll; static PyObject *__pyx_n_s_copy; static PyObject *__pyx_n_s_cytoolz_dicttoolz; static PyObject *__pyx_kp_s_cytoolz_dicttoolz_pyx; static PyObject *__pyx_n_s_d; static PyObject *__pyx_n_s_default; static PyObject *__pyx_n_s_dicts; static PyObject *__pyx_n_s_difference_update; static PyObject *__pyx_n_s_dissoc; static PyObject *__pyx_kp_u_dissoc_line_448; static PyObject *__pyx_n_s_factory; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_func; static PyObject *__pyx_n_s_get_in; static PyObject *__pyx_kp_u_get_in_line_536; static PyObject *__pyx_n_s_getstate; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_it; static PyObject *__pyx_n_s_itemfilter; static PyObject *__pyx_kp_u_itemfilter_line_331; static PyObject *__pyx_n_s_itemmap; static PyObject *__pyx_kp_u_itemmap_line_237; static PyObject *__pyx_n_s_items; static PyObject *__pyx_n_s_iter_mapping; static PyObject *__pyx_n_s_iter_mapping___reduce_cython; static PyObject *__pyx_n_s_iter_mapping___setstate_cython; static PyObject *__pyx_n_s_iteritems; static PyObject *__pyx_n_s_key; static PyObject *__pyx_n_s_keyfilter; static PyObject *__pyx_kp_u_keyfilter_line_299; static PyObject *__pyx_n_s_keymap; static PyObject *__pyx_kp_u_keymap_line_208; static PyObject *__pyx_n_s_keys; static PyObject *__pyx_n_s_kwargs; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_merge; static PyObject *__pyx_kp_u_merge_line_100; static PyObject *__pyx_n_s_merge_with; static PyObject *__pyx_kp_u_merge_with_line_157; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_no_default; static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; static PyObject *__pyx_n_s_pop; static PyObject *__pyx_n_s_popitem; static PyObject *__pyx_n_s_predicate; static PyObject *__pyx_n_s_pyx_state; static PyObject *__pyx_n_s_reduce; static PyObject *__pyx_n_s_reduce_cython; static PyObject *__pyx_n_s_reduce_ex; static PyObject *__pyx_n_s_self; static PyObject *__pyx_n_s_setstate; static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_kp_s_stringsource; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_update; static PyObject *__pyx_n_s_update_in; static PyObject *__pyx_kp_u_update_in_line_465; static PyObject *__pyx_n_s_valfilter; static PyObject *__pyx_kp_u_valfilter_line_267; static PyObject *__pyx_n_s_valmap; static PyObject *__pyx_kp_u_valmap_line_179; static PyObject *__pyx_n_s_value; static int __pyx_pf_7cytoolz_9dicttoolz_13_iter_mapping___cinit__(struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *__pyx_v_self, PyObject *__pyx_v_it); /* proto */ static PyObject *__pyx_pf_7cytoolz_9dicttoolz_13_iter_mapping_2__iter__(struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9dicttoolz_13_iter_mapping_4__next__(struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9dicttoolz_13_iter_mapping_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9dicttoolz_13_iter_mapping_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9dicttoolz_merge(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dicts, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9dicttoolz_2merge_with(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_dicts, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9dicttoolz_4valmap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_d, PyObject *__pyx_v_factory); /* proto */ static PyObject *__pyx_pf_7cytoolz_9dicttoolz_6keymap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_d, PyObject *__pyx_v_factory); /* proto */ static PyObject *__pyx_pf_7cytoolz_9dicttoolz_8itemmap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_d, PyObject *__pyx_v_factory); /* proto */ static PyObject *__pyx_pf_7cytoolz_9dicttoolz_10valfilter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_predicate, PyObject *__pyx_v_d, PyObject *__pyx_v_factory); /* proto */ static PyObject *__pyx_pf_7cytoolz_9dicttoolz_12keyfilter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_predicate, PyObject *__pyx_v_d, PyObject *__pyx_v_factory); /* proto */ static PyObject *__pyx_pf_7cytoolz_9dicttoolz_14itemfilter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_predicate, PyObject *__pyx_v_d, PyObject *__pyx_v_factory); /* proto */ static PyObject *__pyx_pf_7cytoolz_9dicttoolz_16assoc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_d, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_factory); /* proto */ static PyObject *__pyx_pf_7cytoolz_9dicttoolz_18assoc_in(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_d, PyObject *__pyx_v_keys, PyObject *__pyx_v_value, PyObject *__pyx_v_factory); /* proto */ static PyObject *__pyx_pf_7cytoolz_9dicttoolz_20dissoc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_d, PyObject *__pyx_v_keys, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9dicttoolz_22update_in(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_d, PyObject *__pyx_v_keys, PyObject *__pyx_v_func, PyObject *__pyx_v_default, PyObject *__pyx_v_factory); /* proto */ static PyObject *__pyx_pf_7cytoolz_9dicttoolz_24get_in(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_keys, PyObject *__pyx_v_coll, PyObject *__pyx_v_default, PyObject *__pyx_v_no_default); /* proto */ static PyObject *__pyx_tp_new_7cytoolz_9dicttoolz__iter_mapping(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static __Pyx_CachedCFunction __pyx_umethod_PySet_Type_difference_update = {0, &__pyx_n_s_difference_update, 0, 0, 0}; static PyObject *__pyx_int_1; static PyObject *__pyx_k__3; static PyObject *__pyx_k__4; static PyObject *__pyx_k__5; static PyObject *__pyx_k__6; static PyObject *__pyx_k__7; static PyObject *__pyx_k__8; static PyObject *__pyx_k__9; static PyObject *__pyx_k__10; static PyObject *__pyx_k__11; static PyObject *__pyx_k__12; static PyObject *__pyx_k__14; static PyObject *__pyx_k__15; static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_slice__13; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__20; static PyObject *__pyx_tuple__22; static PyObject *__pyx_tuple__24; static PyObject *__pyx_tuple__26; static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__30; static PyObject *__pyx_tuple__32; static PyObject *__pyx_tuple__34; static PyObject *__pyx_tuple__36; static PyObject *__pyx_tuple__38; static PyObject *__pyx_tuple__40; static PyObject *__pyx_tuple__42; static PyObject *__pyx_tuple__44; static PyObject *__pyx_tuple__45; static PyObject *__pyx_codeobj__17; static PyObject *__pyx_codeobj__19; static PyObject *__pyx_codeobj__21; static PyObject *__pyx_codeobj__23; static PyObject *__pyx_codeobj__25; static PyObject *__pyx_codeobj__27; static PyObject *__pyx_codeobj__29; static PyObject *__pyx_codeobj__31; static PyObject *__pyx_codeobj__33; static PyObject *__pyx_codeobj__35; static PyObject *__pyx_codeobj__37; static PyObject *__pyx_codeobj__39; static PyObject *__pyx_codeobj__41; static PyObject *__pyx_codeobj__43; static PyObject *__pyx_codeobj__46; /* Late includes */ /* "cytoolz/dicttoolz.pyx":21 * cdef class _iter_mapping: * """ Keep a handle on the current item to prevent memory clean up too early""" * def __cinit__(self, object it): # <<<<<<<<<<<<<< * self.it = it * self.cur = None */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9dicttoolz_13_iter_mapping_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9dicttoolz_13_iter_mapping_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_it = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_it,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); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_it)) != 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, "__cinit__") < 0)) __PYX_ERR(0, 21, __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_it = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 21, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.dicttoolz._iter_mapping.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9dicttoolz_13_iter_mapping___cinit__(((struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *)__pyx_v_self), __pyx_v_it); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9dicttoolz_13_iter_mapping___cinit__(struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *__pyx_v_self, PyObject *__pyx_v_it) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/dicttoolz.pyx":22 * """ Keep a handle on the current item to prevent memory clean up too early""" * def __cinit__(self, object it): * self.it = it # <<<<<<<<<<<<<< * self.cur = None * */ __Pyx_INCREF(__pyx_v_it); __Pyx_GIVEREF(__pyx_v_it); __Pyx_GOTREF(__pyx_v_self->it); __Pyx_DECREF(__pyx_v_self->it); __pyx_v_self->it = __pyx_v_it; /* "cytoolz/dicttoolz.pyx":23 * def __cinit__(self, object it): * self.it = it * self.cur = None # <<<<<<<<<<<<<< * * def __iter__(self): */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->cur); __Pyx_DECREF(__pyx_v_self->cur); __pyx_v_self->cur = Py_None; /* "cytoolz/dicttoolz.pyx":21 * cdef class _iter_mapping: * """ Keep a handle on the current item to prevent memory clean up too early""" * def __cinit__(self, object it): # <<<<<<<<<<<<<< * self.it = it * self.cur = None */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/dicttoolz.pyx":25 * self.cur = None * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_13_iter_mapping_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_13_iter_mapping_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9dicttoolz_13_iter_mapping_2__iter__(((struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9dicttoolz_13_iter_mapping_2__iter__(struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* "cytoolz/dicttoolz.pyx":26 * * 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; /* "cytoolz/dicttoolz.pyx":25 * self.cur = None * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/dicttoolz.pyx":28 * return self * * def __next__(self): # <<<<<<<<<<<<<< * self.cur = next(self.it) * return self.cur */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_13_iter_mapping_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_13_iter_mapping_5__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9dicttoolz_13_iter_mapping_4__next__(((struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9dicttoolz_13_iter_mapping_4__next__(struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/dicttoolz.pyx":29 * * def __next__(self): * self.cur = next(self.it) # <<<<<<<<<<<<<< * return self.cur * */ __pyx_t_1 = __pyx_v_self->it; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 29, __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->cur); __Pyx_DECREF(__pyx_v_self->cur); __pyx_v_self->cur = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":30 * def __next__(self): * self.cur = next(self.it) * return self.cur # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->cur); __pyx_r = __pyx_v_self->cur; goto __pyx_L0; /* "cytoolz/dicttoolz.pyx":28 * return self * * def __next__(self): # <<<<<<<<<<<<<< * self.cur = next(self.it) * return self.cur */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.dicttoolz._iter_mapping.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_13_iter_mapping_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9dicttoolz_13_iter_mapping_6__reduce_cython__[] = "_iter_mapping.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9dicttoolz_13_iter_mapping_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9dicttoolz_13_iter_mapping_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9dicttoolz_13_iter_mapping_6__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9dicttoolz_13_iter_mapping_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9dicttoolz_13_iter_mapping_6__reduce_cython__(((struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9dicttoolz_13_iter_mapping_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.dicttoolz._iter_mapping.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_13_iter_mapping_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9dicttoolz_13_iter_mapping_8__setstate_cython__[] = "_iter_mapping.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9dicttoolz_13_iter_mapping_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9dicttoolz_13_iter_mapping_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9dicttoolz_13_iter_mapping_8__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9dicttoolz_13_iter_mapping_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9dicttoolz_13_iter_mapping_8__setstate_cython__(((struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9dicttoolz_13_iter_mapping_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.dicttoolz._iter_mapping.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/dicttoolz.pyx":33 * * * cdef int PyMapping_Next(object p, Py_ssize_t *ppos, PyObject* *pkey, PyObject* *pval) except -1: # <<<<<<<<<<<<<< * """Mimic "PyDict_Next" interface, but for any mapping""" * cdef PyObject *obj */ static int __pyx_f_7cytoolz_9dicttoolz_PyMapping_Next(PyObject *__pyx_v_p, CYTHON_UNUSED Py_ssize_t *__pyx_v_ppos, PyObject **__pyx_v_pkey, PyObject **__pyx_v_pval) { PyObject *__pyx_v_obj; int __pyx_r; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("PyMapping_Next", 0); /* "cytoolz/dicttoolz.pyx":36 * """Mimic "PyDict_Next" interface, but for any mapping""" * cdef PyObject *obj * obj = PtrIter_Next(p) # <<<<<<<<<<<<<< * if obj is NULL: * return 0 */ __pyx_v_obj = PyIter_Next(__pyx_v_p); /* "cytoolz/dicttoolz.pyx":37 * cdef PyObject *obj * obj = PtrIter_Next(p) * if obj is NULL: # <<<<<<<<<<<<<< * return 0 * pkey[0] = (obj)[0] */ __pyx_t_1 = ((__pyx_v_obj == NULL) != 0); if (__pyx_t_1) { /* "cytoolz/dicttoolz.pyx":38 * obj = PtrIter_Next(p) * if obj is NULL: * return 0 # <<<<<<<<<<<<<< * pkey[0] = (obj)[0] * pval[0] = (obj)[1] */ __pyx_r = 0; goto __pyx_L0; /* "cytoolz/dicttoolz.pyx":37 * cdef PyObject *obj * obj = PtrIter_Next(p) * if obj is NULL: # <<<<<<<<<<<<<< * return 0 * pkey[0] = (obj)[0] */ } /* "cytoolz/dicttoolz.pyx":39 * if obj is NULL: * return 0 * pkey[0] = (obj)[0] # <<<<<<<<<<<<<< * pval[0] = (obj)[1] * Py_XDECREF(obj) # removing this results in memory leak */ __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_obj), 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); (__pyx_v_pkey[0]) = ((PyObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":40 * return 0 * pkey[0] = (obj)[0] * pval[0] = (obj)[1] # <<<<<<<<<<<<<< * Py_XDECREF(obj) # removing this results in memory leak * return 1 */ __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_obj), 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); (__pyx_v_pval[0]) = ((PyObject *)__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":41 * pkey[0] = (obj)[0] * pval[0] = (obj)[1] * Py_XDECREF(obj) # removing this results in memory leak # <<<<<<<<<<<<<< * return 1 * */ Py_XDECREF(__pyx_v_obj); /* "cytoolz/dicttoolz.pyx":42 * pval[0] = (obj)[1] * Py_XDECREF(obj) # removing this results in memory leak * return 1 # <<<<<<<<<<<<<< * * */ __pyx_r = 1; goto __pyx_L0; /* "cytoolz/dicttoolz.pyx":33 * * * cdef int PyMapping_Next(object p, Py_ssize_t *ppos, PyObject* *pkey, PyObject* *pval) except -1: # <<<<<<<<<<<<<< * """Mimic "PyDict_Next" interface, but for any mapping""" * cdef PyObject *obj */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.dicttoolz.PyMapping_Next", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/dicttoolz.pyx":45 * * * cdef f_map_next get_map_iter(object d, PyObject* *ptr) except NULL: # <<<<<<<<<<<<<< * """Return function pointer to perform iteration over object returned in ptr. * */ static __pyx_t_7cytoolz_9dicttoolz_f_map_next __pyx_f_7cytoolz_9dicttoolz_get_map_iter(PyObject *__pyx_v_d, PyObject **__pyx_v_ptr) { PyObject *__pyx_v_val = 0; __pyx_t_7cytoolz_9dicttoolz_f_map_next __pyx_v_rv; __pyx_t_7cytoolz_9dicttoolz_f_map_next __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; __Pyx_RefNannySetupContext("get_map_iter", 0); /* "cytoolz/dicttoolz.pyx":66 * cdef object val * cdef f_map_next rv * if PyDict_CheckExact(d): # <<<<<<<<<<<<<< * val = d * rv = &PyDict_Next_Compat */ __pyx_t_1 = (PyDict_CheckExact(__pyx_v_d) != 0); if (__pyx_t_1) { /* "cytoolz/dicttoolz.pyx":67 * cdef f_map_next rv * if PyDict_CheckExact(d): * val = d # <<<<<<<<<<<<<< * rv = &PyDict_Next_Compat * elif hasattr(d, 'iteritems'): */ __Pyx_INCREF(__pyx_v_d); __pyx_v_val = __pyx_v_d; /* "cytoolz/dicttoolz.pyx":68 * if PyDict_CheckExact(d): * val = d * rv = &PyDict_Next_Compat # <<<<<<<<<<<<<< * elif hasattr(d, 'iteritems'): * val = _iter_mapping(iter(d.iteritems())) */ __pyx_v_rv = (&PyDict_Next); /* "cytoolz/dicttoolz.pyx":66 * cdef object val * cdef f_map_next rv * if PyDict_CheckExact(d): # <<<<<<<<<<<<<< * val = d * rv = &PyDict_Next_Compat */ goto __pyx_L3; } /* "cytoolz/dicttoolz.pyx":69 * val = d * rv = &PyDict_Next_Compat * elif hasattr(d, 'iteritems'): # <<<<<<<<<<<<<< * val = _iter_mapping(iter(d.iteritems())) * rv = &PyMapping_Next */ __pyx_t_1 = __Pyx_HasAttr(__pyx_v_d, __pyx_n_s_iteritems); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 69, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "cytoolz/dicttoolz.pyx":70 * rv = &PyDict_Next_Compat * elif hasattr(d, 'iteritems'): * val = _iter_mapping(iter(d.iteritems())) # <<<<<<<<<<<<<< * rv = &PyMapping_Next * else: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_iteritems); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7cytoolz_9dicttoolz__iter_mapping), __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_val = __pyx_t_3; __pyx_t_3 = 0; /* "cytoolz/dicttoolz.pyx":71 * elif hasattr(d, 'iteritems'): * val = _iter_mapping(iter(d.iteritems())) * rv = &PyMapping_Next # <<<<<<<<<<<<<< * else: * val = _iter_mapping(iter(d.items())) */ __pyx_v_rv = (&__pyx_f_7cytoolz_9dicttoolz_PyMapping_Next); /* "cytoolz/dicttoolz.pyx":69 * val = d * rv = &PyDict_Next_Compat * elif hasattr(d, 'iteritems'): # <<<<<<<<<<<<<< * val = _iter_mapping(iter(d.iteritems())) * rv = &PyMapping_Next */ goto __pyx_L3; } /* "cytoolz/dicttoolz.pyx":73 * rv = &PyMapping_Next * else: * val = _iter_mapping(iter(d.items())) # <<<<<<<<<<<<<< * rv = &PyMapping_Next * Py_INCREF(val) */ /*else*/ { __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_d, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7cytoolz_9dicttoolz__iter_mapping), __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 73, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_val = __pyx_t_3; __pyx_t_3 = 0; /* "cytoolz/dicttoolz.pyx":74 * else: * val = _iter_mapping(iter(d.items())) * rv = &PyMapping_Next # <<<<<<<<<<<<<< * Py_INCREF(val) * ptr[0] = val */ __pyx_v_rv = (&__pyx_f_7cytoolz_9dicttoolz_PyMapping_Next); } __pyx_L3:; /* "cytoolz/dicttoolz.pyx":75 * val = _iter_mapping(iter(d.items())) * rv = &PyMapping_Next * Py_INCREF(val) # <<<<<<<<<<<<<< * ptr[0] = val * return rv */ Py_INCREF(__pyx_v_val); /* "cytoolz/dicttoolz.pyx":76 * rv = &PyMapping_Next * Py_INCREF(val) * ptr[0] = val # <<<<<<<<<<<<<< * return rv * */ (__pyx_v_ptr[0]) = ((PyObject *)__pyx_v_val); /* "cytoolz/dicttoolz.pyx":77 * Py_INCREF(val) * ptr[0] = val * return rv # <<<<<<<<<<<<<< * * */ __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "cytoolz/dicttoolz.pyx":45 * * * cdef f_map_next get_map_iter(object d, PyObject* *ptr) except NULL: # <<<<<<<<<<<<<< * """Return function pointer to perform iteration over object returned in ptr. * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("cytoolz.dicttoolz.get_map_iter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_val); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/dicttoolz.pyx":80 * * * cdef get_factory(name, kwargs): # <<<<<<<<<<<<<< * factory = kwargs.pop('factory', dict) * if kwargs: */ static PyObject *__pyx_f_7cytoolz_9dicttoolz_get_factory(PyObject *__pyx_v_name, PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_factory = 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; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("get_factory", 0); /* "cytoolz/dicttoolz.pyx":81 * * cdef get_factory(name, kwargs): * factory = kwargs.pop('factory', dict) # <<<<<<<<<<<<<< * if kwargs: * raise TypeError("{0}() got an unexpected keyword argument " */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_kwargs, __pyx_n_s_pop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_n_s_factory, ((PyObject *)(&PyDict_Type))}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_n_s_factory, ((PyObject *)(&PyDict_Type))}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 81, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_n_s_factory); __Pyx_GIVEREF(__pyx_n_s_factory); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_n_s_factory); __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __Pyx_GIVEREF(((PyObject *)(&PyDict_Type))); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)(&PyDict_Type))); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __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_v_factory = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":82 * cdef get_factory(name, kwargs): * factory = kwargs.pop('factory', dict) * if kwargs: # <<<<<<<<<<<<<< * raise TypeError("{0}() got an unexpected keyword argument " * "'{1}'".format(name, kwargs.popitem()[0])) */ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 82, __pyx_L1_error) if (unlikely(__pyx_t_6)) { /* "cytoolz/dicttoolz.pyx":84 * if kwargs: * raise TypeError("{0}() got an unexpected keyword argument " * "'{1}'".format(name, kwargs.popitem()[0])) # <<<<<<<<<<<<<< * return factory * */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_got_an_unexpected_keyword_arg, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_kwargs, __pyx_n_s_popitem); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_name, __pyx_t_3}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_name, __pyx_t_3}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 84, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_name); __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_4, __pyx_v_name); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_4, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __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; /* "cytoolz/dicttoolz.pyx":83 * factory = kwargs.pop('factory', dict) * if kwargs: * raise TypeError("{0}() got an unexpected keyword argument " # <<<<<<<<<<<<<< * "'{1}'".format(name, kwargs.popitem()[0])) * return factory */ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __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_ERR(0, 83, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":82 * cdef get_factory(name, kwargs): * factory = kwargs.pop('factory', dict) * if kwargs: # <<<<<<<<<<<<<< * raise TypeError("{0}() got an unexpected keyword argument " * "'{1}'".format(name, kwargs.popitem()[0])) */ } /* "cytoolz/dicttoolz.pyx":85 * raise TypeError("{0}() got an unexpected keyword argument " * "'{1}'".format(name, kwargs.popitem()[0])) * return factory # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_factory); __pyx_r = __pyx_v_factory; goto __pyx_L0; /* "cytoolz/dicttoolz.pyx":80 * * * cdef get_factory(name, kwargs): # <<<<<<<<<<<<<< * factory = kwargs.pop('factory', dict) * if kwargs: */ /* 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_7); __Pyx_AddTraceback("cytoolz.dicttoolz.get_factory", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_factory); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/dicttoolz.pyx":88 * * * cdef object c_merge(object dicts, object factory=dict): # <<<<<<<<<<<<<< * cdef object rv * rv = factory() */ static PyObject *__pyx_f_7cytoolz_9dicttoolz_c_merge(PyObject *__pyx_v_dicts, struct __pyx_opt_args_7cytoolz_9dicttoolz_c_merge *__pyx_optional_args) { PyObject *__pyx_v_factory = __pyx_k__3; PyObject *__pyx_v_rv = 0; PyObject *__pyx_v_d = 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)(PyObject *); int __pyx_t_7; PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("c_merge", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_factory = __pyx_optional_args->factory; } } /* "cytoolz/dicttoolz.pyx":90 * cdef object c_merge(object dicts, object factory=dict): * cdef object rv * rv = factory() # <<<<<<<<<<<<<< * if PyDict_CheckExact(rv): * for d in dicts: */ __Pyx_INCREF(__pyx_v_factory); __pyx_t_2 = __pyx_v_factory; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":91 * cdef object rv * rv = factory() * if PyDict_CheckExact(rv): # <<<<<<<<<<<<<< * for d in dicts: * PyDict_Update(rv, d) */ __pyx_t_4 = (PyDict_CheckExact(__pyx_v_rv) != 0); if (__pyx_t_4) { /* "cytoolz/dicttoolz.pyx":92 * rv = factory() * if PyDict_CheckExact(rv): * for d in dicts: # <<<<<<<<<<<<<< * PyDict_Update(rv, d) * else: */ if (likely(PyList_CheckExact(__pyx_v_dicts)) || PyTuple_CheckExact(__pyx_v_dicts)) { __pyx_t_1 = __pyx_v_dicts; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_dicts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 92, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 92, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 92, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 92, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 92, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":93 * if PyDict_CheckExact(rv): * for d in dicts: * PyDict_Update(rv, d) # <<<<<<<<<<<<<< * else: * for d in dicts: */ __pyx_t_7 = PyDict_Update(__pyx_v_rv, __pyx_v_d); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 93, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":92 * rv = factory() * if PyDict_CheckExact(rv): * for d in dicts: # <<<<<<<<<<<<<< * PyDict_Update(rv, d) * else: */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":91 * cdef object rv * rv = factory() * if PyDict_CheckExact(rv): # <<<<<<<<<<<<<< * for d in dicts: * PyDict_Update(rv, d) */ goto __pyx_L3; } /* "cytoolz/dicttoolz.pyx":95 * PyDict_Update(rv, d) * else: * for d in dicts: # <<<<<<<<<<<<<< * rv.update(d) * return rv */ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_dicts)) || PyTuple_CheckExact(__pyx_v_dicts)) { __pyx_t_1 = __pyx_v_dicts; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_dicts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 95, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 95, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 95, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_6(__pyx_t_1); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 95, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":96 * else: * for d in dicts: * rv.update(d) # <<<<<<<<<<<<<< * return rv * */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_rv, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_8, __pyx_v_d) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_d); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":95 * PyDict_Update(rv, d) * else: * for d in dicts: # <<<<<<<<<<<<<< * rv.update(d) * return rv */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "cytoolz/dicttoolz.pyx":97 * for d in dicts: * rv.update(d) * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "cytoolz/dicttoolz.pyx":88 * * * cdef object c_merge(object dicts, object factory=dict): # <<<<<<<<<<<<<< * cdef object rv * rv = factory() */ /* 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_AddTraceback("cytoolz.dicttoolz.c_merge", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_d); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/dicttoolz.pyx":100 * * * def merge(*dicts, **kwargs): # <<<<<<<<<<<<<< * """ * Merge a collection of dictionaries */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_1merge(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9dicttoolz_merge[] = "merge(*dicts, **kwargs)\n\n Merge a collection of dictionaries\n\n >>> merge({1: 'one'}, {2: 'two'})\n {1: 'one', 2: 'two'}\n\n Later dictionaries have precedence\n\n >>> merge({1: 2, 3: 4}, {3: 3, 4: 4})\n {1: 2, 3: 3, 4: 4}\n\n See Also:\n merge_with\n "; static PyMethodDef __pyx_mdef_7cytoolz_9dicttoolz_1merge = {"merge", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9dicttoolz_1merge, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9dicttoolz_merge}; static PyObject *__pyx_pw_7cytoolz_9dicttoolz_1merge(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_dicts = 0; PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("merge (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "merge", 1))) return NULL; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_dicts = __pyx_args; __pyx_r = __pyx_pf_7cytoolz_9dicttoolz_merge(__pyx_self, __pyx_v_dicts, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_dicts); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9dicttoolz_merge(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dicts, PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_factory = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; struct __pyx_opt_args_7cytoolz_9dicttoolz_c_merge __pyx_t_5; __Pyx_RefNannySetupContext("merge", 0); __Pyx_INCREF(__pyx_v_dicts); /* "cytoolz/dicttoolz.pyx":115 * merge_with * """ * if len(dicts) == 1 and not PyDict_Check(dicts[0]): # <<<<<<<<<<<<<< * dicts = dicts[0] * factory = get_factory('merge', kwargs) */ __pyx_t_2 = PyObject_Length(__pyx_v_dicts); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 115, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_2 == 1) != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_dicts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = ((!(PyDict_Check(__pyx_t_4) != 0)) != 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "cytoolz/dicttoolz.pyx":116 * """ * if len(dicts) == 1 and not PyDict_Check(dicts[0]): * dicts = dicts[0] # <<<<<<<<<<<<<< * factory = get_factory('merge', kwargs) * return c_merge(dicts, factory) */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_dicts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_dicts, __pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/dicttoolz.pyx":115 * merge_with * """ * if len(dicts) == 1 and not PyDict_Check(dicts[0]): # <<<<<<<<<<<<<< * dicts = dicts[0] * factory = get_factory('merge', kwargs) */ } /* "cytoolz/dicttoolz.pyx":117 * if len(dicts) == 1 and not PyDict_Check(dicts[0]): * dicts = dicts[0] * factory = get_factory('merge', kwargs) # <<<<<<<<<<<<<< * return c_merge(dicts, factory) * */ __pyx_t_4 = __pyx_f_7cytoolz_9dicttoolz_get_factory(__pyx_n_s_merge, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_factory = __pyx_t_4; __pyx_t_4 = 0; /* "cytoolz/dicttoolz.pyx":118 * dicts = dicts[0] * factory = get_factory('merge', kwargs) * return c_merge(dicts, factory) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_5.__pyx_n = 1; __pyx_t_5.factory = __pyx_v_factory; __pyx_t_4 = __pyx_f_7cytoolz_9dicttoolz_c_merge(__pyx_v_dicts, &__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "cytoolz/dicttoolz.pyx":100 * * * def merge(*dicts, **kwargs): # <<<<<<<<<<<<<< * """ * Merge a collection of dictionaries */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("cytoolz.dicttoolz.merge", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dicts); __Pyx_XDECREF(__pyx_v_factory); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/dicttoolz.pyx":121 * * * cdef object c_merge_with(object func, object dicts, object factory=dict): # <<<<<<<<<<<<<< * cdef: * dict result */ static PyObject *__pyx_f_7cytoolz_9dicttoolz_c_merge_with(PyObject *__pyx_v_func, PyObject *__pyx_v_dicts, struct __pyx_opt_args_7cytoolz_9dicttoolz_c_merge_with *__pyx_optional_args) { PyObject *__pyx_v_factory = __pyx_k__4; PyObject *__pyx_v_result = 0; PyObject *__pyx_v_rv = 0; PyObject *__pyx_v_d = 0; PyObject *__pyx_v_seq = 0; __pyx_t_7cytoolz_9dicttoolz_f_map_next __pyx_v_f; PyObject *__pyx_v_obj; PyObject *__pyx_v_pkey; PyObject *__pyx_v_pval; Py_ssize_t __pyx_v_pos; 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 *); __pyx_t_7cytoolz_9dicttoolz_f_map_next __pyx_t_6; int __pyx_t_7; int __pyx_t_8; __Pyx_RefNannySetupContext("c_merge_with", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_factory = __pyx_optional_args->factory; } } /* "cytoolz/dicttoolz.pyx":132 * Py_ssize_t pos * * result = PyDict_New() # <<<<<<<<<<<<<< * rv = factory() * for d in dicts: */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":133 * * result = PyDict_New() * rv = factory() # <<<<<<<<<<<<<< * for d in dicts: * f = get_map_iter(d, &obj) */ __Pyx_INCREF(__pyx_v_factory); __pyx_t_2 = __pyx_v_factory; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":134 * result = PyDict_New() * rv = factory() * for d in dicts: # <<<<<<<<<<<<<< * f = get_map_iter(d, &obj) * d = obj */ if (likely(PyList_CheckExact(__pyx_v_dicts)) || PyTuple_CheckExact(__pyx_v_dicts)) { __pyx_t_1 = __pyx_v_dicts; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_dicts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 134, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 134, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 134, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } } else { __pyx_t_2 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 134, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":135 * rv = factory() * for d in dicts: * f = get_map_iter(d, &obj) # <<<<<<<<<<<<<< * d = obj * Py_DECREF(d) */ __pyx_t_6 = __pyx_f_7cytoolz_9dicttoolz_get_map_iter(__pyx_v_d, (&__pyx_v_obj)); if (unlikely(__pyx_t_6 == ((__pyx_t_7cytoolz_9dicttoolz_f_map_next)NULL))) __PYX_ERR(0, 135, __pyx_L1_error) __pyx_v_f = __pyx_t_6; /* "cytoolz/dicttoolz.pyx":136 * for d in dicts: * f = get_map_iter(d, &obj) * d = obj # <<<<<<<<<<<<<< * Py_DECREF(d) * pos = 0 */ __pyx_t_2 = ((PyObject *)__pyx_v_obj); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_d, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":137 * f = get_map_iter(d, &obj) * d = obj * Py_DECREF(d) # <<<<<<<<<<<<<< * pos = 0 * while f(d, &pos, &pkey, &pval): */ Py_DECREF(__pyx_v_d); /* "cytoolz/dicttoolz.pyx":138 * d = obj * Py_DECREF(d) * pos = 0 # <<<<<<<<<<<<<< * while f(d, &pos, &pkey, &pval): * obj = PyDict_GetItem(result, pkey) */ __pyx_v_pos = 0; /* "cytoolz/dicttoolz.pyx":139 * Py_DECREF(d) * pos = 0 * while f(d, &pos, &pkey, &pval): # <<<<<<<<<<<<<< * obj = PyDict_GetItem(result, pkey) * if obj is NULL: */ while (1) { __pyx_t_7 = __pyx_v_f(__pyx_v_d, (&__pyx_v_pos), (&__pyx_v_pkey), (&__pyx_v_pval)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 139, __pyx_L1_error) __pyx_t_8 = (__pyx_t_7 != 0); if (!__pyx_t_8) break; /* "cytoolz/dicttoolz.pyx":140 * pos = 0 * while f(d, &pos, &pkey, &pval): * obj = PyDict_GetItem(result, pkey) # <<<<<<<<<<<<<< * if obj is NULL: * seq = PyList_New(0) */ __pyx_v_obj = PyDict_GetItem(__pyx_v_result, ((PyObject *)__pyx_v_pkey)); /* "cytoolz/dicttoolz.pyx":141 * while f(d, &pos, &pkey, &pval): * obj = PyDict_GetItem(result, pkey) * if obj is NULL: # <<<<<<<<<<<<<< * seq = PyList_New(0) * PyList_Append(seq, pval) */ __pyx_t_8 = ((__pyx_v_obj == NULL) != 0); if (__pyx_t_8) { /* "cytoolz/dicttoolz.pyx":142 * obj = PyDict_GetItem(result, pkey) * if obj is NULL: * seq = PyList_New(0) # <<<<<<<<<<<<<< * PyList_Append(seq, pval) * PyDict_SetItem(result, pkey, seq) */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_seq, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":143 * if obj is NULL: * seq = PyList_New(0) * PyList_Append(seq, pval) # <<<<<<<<<<<<<< * PyDict_SetItem(result, pkey, seq) * else: */ __pyx_t_7 = PyList_Append(__pyx_v_seq, ((PyObject *)__pyx_v_pval)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 143, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":144 * seq = PyList_New(0) * PyList_Append(seq, pval) * PyDict_SetItem(result, pkey, seq) # <<<<<<<<<<<<<< * else: * PyList_Append(obj, pval) */ __pyx_t_7 = PyDict_SetItem(__pyx_v_result, ((PyObject *)__pyx_v_pkey), __pyx_v_seq); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 144, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":141 * while f(d, &pos, &pkey, &pval): * obj = PyDict_GetItem(result, pkey) * if obj is NULL: # <<<<<<<<<<<<<< * seq = PyList_New(0) * PyList_Append(seq, pval) */ goto __pyx_L7; } /* "cytoolz/dicttoolz.pyx":146 * PyDict_SetItem(result, pkey, seq) * else: * PyList_Append(obj, pval) # <<<<<<<<<<<<<< * * f = get_map_iter(result, &obj) */ /*else*/ { __pyx_t_7 = PyList_Append(((PyObject *)__pyx_v_obj), ((PyObject *)__pyx_v_pval)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 146, __pyx_L1_error) } __pyx_L7:; } /* "cytoolz/dicttoolz.pyx":134 * result = PyDict_New() * rv = factory() * for d in dicts: # <<<<<<<<<<<<<< * f = get_map_iter(d, &obj) * d = obj */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":148 * PyList_Append(obj, pval) * * f = get_map_iter(result, &obj) # <<<<<<<<<<<<<< * d = obj * Py_DECREF(d) */ __pyx_t_6 = __pyx_f_7cytoolz_9dicttoolz_get_map_iter(__pyx_v_result, (&__pyx_v_obj)); if (unlikely(__pyx_t_6 == ((__pyx_t_7cytoolz_9dicttoolz_f_map_next)NULL))) __PYX_ERR(0, 148, __pyx_L1_error) __pyx_v_f = __pyx_t_6; /* "cytoolz/dicttoolz.pyx":149 * * f = get_map_iter(result, &obj) * d = obj # <<<<<<<<<<<<<< * Py_DECREF(d) * pos = 0 */ __pyx_t_1 = ((PyObject *)__pyx_v_obj); __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":150 * f = get_map_iter(result, &obj) * d = obj * Py_DECREF(d) # <<<<<<<<<<<<<< * pos = 0 * while f(d, &pos, &pkey, &pval): */ Py_DECREF(__pyx_v_d); /* "cytoolz/dicttoolz.pyx":151 * d = obj * Py_DECREF(d) * pos = 0 # <<<<<<<<<<<<<< * while f(d, &pos, &pkey, &pval): * PyObject_SetItem(rv, pkey, func(pval)) */ __pyx_v_pos = 0; /* "cytoolz/dicttoolz.pyx":152 * Py_DECREF(d) * pos = 0 * while f(d, &pos, &pkey, &pval): # <<<<<<<<<<<<<< * PyObject_SetItem(rv, pkey, func(pval)) * return rv */ while (1) { __pyx_t_7 = __pyx_v_f(__pyx_v_d, (&__pyx_v_pos), (&__pyx_v_pkey), (&__pyx_v_pval)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 152, __pyx_L1_error) __pyx_t_8 = (__pyx_t_7 != 0); if (!__pyx_t_8) break; /* "cytoolz/dicttoolz.pyx":153 * pos = 0 * while f(d, &pos, &pkey, &pval): * PyObject_SetItem(rv, pkey, func(pval)) # <<<<<<<<<<<<<< * return rv * */ __Pyx_INCREF(__pyx_v_func); __pyx_t_2 = __pyx_v_func; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_pval)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_pval)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_7 = PyObject_SetItem(__pyx_v_rv, ((PyObject *)__pyx_v_pkey), __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "cytoolz/dicttoolz.pyx":154 * while f(d, &pos, &pkey, &pval): * PyObject_SetItem(rv, pkey, func(pval)) * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "cytoolz/dicttoolz.pyx":121 * * * cdef object c_merge_with(object func, object dicts, object factory=dict): # <<<<<<<<<<<<<< * cdef: * dict result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.dicttoolz.c_merge_with", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_d); __Pyx_XDECREF(__pyx_v_seq); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/dicttoolz.pyx":157 * * * def merge_with(func, *dicts, **kwargs): # <<<<<<<<<<<<<< * """ * Merge dictionaries and apply function to combined values */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_3merge_with(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9dicttoolz_2merge_with[] = "merge_with(func, *dicts, **kwargs)\n\n Merge dictionaries and apply function to combined values\n\n A key may occur in more than one dict, and all values mapped from the key\n will be passed to the function as a list, such as func([val1, val2, ...]).\n\n >>> merge_with(sum, {1: 1, 2: 2}, {1: 10, 2: 20})\n {1: 11, 2: 22}\n\n >>> merge_with(first, {1: 1, 2: 2}, {2: 20, 3: 30}) # doctest: +SKIP\n {1: 1, 2: 2, 3: 30}\n\n See Also:\n merge\n "; static PyMethodDef __pyx_mdef_7cytoolz_9dicttoolz_3merge_with = {"merge_with", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9dicttoolz_3merge_with, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9dicttoolz_2merge_with}; static PyObject *__pyx_pw_7cytoolz_9dicttoolz_3merge_with(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_func = 0; PyObject *__pyx_v_dicts = 0; PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("merge_with (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); if (PyTuple_GET_SIZE(__pyx_args) > 1) { __pyx_v_dicts = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); if (unlikely(!__pyx_v_dicts)) { __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_dicts); } else { __pyx_v_dicts = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,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) { default: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "merge_with") < 0)) __PYX_ERR(0, 157, __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_func = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("merge_with", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 157, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_dicts); __pyx_v_dicts = 0; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("cytoolz.dicttoolz.merge_with", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9dicttoolz_2merge_with(__pyx_self, __pyx_v_func, __pyx_v_dicts, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_dicts); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9dicttoolz_2merge_with(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_dicts, PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_factory = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; struct __pyx_opt_args_7cytoolz_9dicttoolz_c_merge_with __pyx_t_5; __Pyx_RefNannySetupContext("merge_with", 0); __Pyx_INCREF(__pyx_v_dicts); /* "cytoolz/dicttoolz.pyx":173 * merge * """ * if len(dicts) == 1 and not PyDict_Check(dicts[0]): # <<<<<<<<<<<<<< * dicts = dicts[0] * factory = get_factory('merge_with', kwargs) */ __pyx_t_2 = PyObject_Length(__pyx_v_dicts); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 173, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_2 == 1) != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_dicts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = ((!(PyDict_Check(__pyx_t_4) != 0)) != 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "cytoolz/dicttoolz.pyx":174 * """ * if len(dicts) == 1 and not PyDict_Check(dicts[0]): * dicts = dicts[0] # <<<<<<<<<<<<<< * factory = get_factory('merge_with', kwargs) * return c_merge_with(func, dicts, factory) */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_dicts, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_dicts, __pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/dicttoolz.pyx":173 * merge * """ * if len(dicts) == 1 and not PyDict_Check(dicts[0]): # <<<<<<<<<<<<<< * dicts = dicts[0] * factory = get_factory('merge_with', kwargs) */ } /* "cytoolz/dicttoolz.pyx":175 * if len(dicts) == 1 and not PyDict_Check(dicts[0]): * dicts = dicts[0] * factory = get_factory('merge_with', kwargs) # <<<<<<<<<<<<<< * return c_merge_with(func, dicts, factory) * */ __pyx_t_4 = __pyx_f_7cytoolz_9dicttoolz_get_factory(__pyx_n_s_merge_with, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_factory = __pyx_t_4; __pyx_t_4 = 0; /* "cytoolz/dicttoolz.pyx":176 * dicts = dicts[0] * factory = get_factory('merge_with', kwargs) * return c_merge_with(func, dicts, factory) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_5.__pyx_n = 1; __pyx_t_5.factory = __pyx_v_factory; __pyx_t_4 = __pyx_f_7cytoolz_9dicttoolz_c_merge_with(__pyx_v_func, __pyx_v_dicts, &__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "cytoolz/dicttoolz.pyx":157 * * * def merge_with(func, *dicts, **kwargs): # <<<<<<<<<<<<<< * """ * Merge dictionaries and apply function to combined values */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("cytoolz.dicttoolz.merge_with", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_dicts); __Pyx_XDECREF(__pyx_v_factory); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/dicttoolz.pyx":179 * * * cpdef object valmap(object func, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Apply function to values of dictionary */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_5valmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_valmap(PyObject *__pyx_v_func, PyObject *__pyx_v_d, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_valmap *__pyx_optional_args) { PyObject *__pyx_v_factory = __pyx_k__5; PyObject *__pyx_v_rv = 0; __pyx_t_7cytoolz_9dicttoolz_f_map_next __pyx_v_f; PyObject *__pyx_v_obj; PyObject *__pyx_v_pkey; PyObject *__pyx_v_pval; Py_ssize_t __pyx_v_pos; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __pyx_t_7cytoolz_9dicttoolz_f_map_next __pyx_t_4; int __pyx_t_5; int __pyx_t_6; __Pyx_RefNannySetupContext("valmap", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_factory = __pyx_optional_args->factory; } } __Pyx_INCREF(__pyx_v_d); /* "cytoolz/dicttoolz.pyx":197 * PyObject *pkey * PyObject *pval * Py_ssize_t pos = 0 # <<<<<<<<<<<<<< * * rv = factory() */ __pyx_v_pos = 0; /* "cytoolz/dicttoolz.pyx":199 * Py_ssize_t pos = 0 * * rv = factory() # <<<<<<<<<<<<<< * f = get_map_iter(d, &obj) * d = obj */ __Pyx_INCREF(__pyx_v_factory); __pyx_t_2 = __pyx_v_factory; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":200 * * rv = factory() * f = get_map_iter(d, &obj) # <<<<<<<<<<<<<< * d = obj * Py_DECREF(d) */ __pyx_t_4 = __pyx_f_7cytoolz_9dicttoolz_get_map_iter(__pyx_v_d, (&__pyx_v_obj)); if (unlikely(__pyx_t_4 == ((__pyx_t_7cytoolz_9dicttoolz_f_map_next)NULL))) __PYX_ERR(0, 200, __pyx_L1_error) __pyx_v_f = __pyx_t_4; /* "cytoolz/dicttoolz.pyx":201 * rv = factory() * f = get_map_iter(d, &obj) * d = obj # <<<<<<<<<<<<<< * Py_DECREF(d) * while f(d, &pos, &pkey, &pval): */ __pyx_t_1 = ((PyObject *)__pyx_v_obj); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_d, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":202 * f = get_map_iter(d, &obj) * d = obj * Py_DECREF(d) # <<<<<<<<<<<<<< * while f(d, &pos, &pkey, &pval): * rv[pkey] = func(pval) */ Py_DECREF(__pyx_v_d); /* "cytoolz/dicttoolz.pyx":203 * d = obj * Py_DECREF(d) * while f(d, &pos, &pkey, &pval): # <<<<<<<<<<<<<< * rv[pkey] = func(pval) * return rv */ while (1) { __pyx_t_5 = __pyx_v_f(__pyx_v_d, (&__pyx_v_pos), (&__pyx_v_pkey), (&__pyx_v_pval)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 203, __pyx_L1_error) __pyx_t_6 = (__pyx_t_5 != 0); if (!__pyx_t_6) break; /* "cytoolz/dicttoolz.pyx":204 * Py_DECREF(d) * while f(d, &pos, &pkey, &pval): * rv[pkey] = func(pval) # <<<<<<<<<<<<<< * return rv * */ __Pyx_INCREF(__pyx_v_func); __pyx_t_2 = __pyx_v_func; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_pval)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_pval)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(PyObject_SetItem(__pyx_v_rv, ((PyObject *)__pyx_v_pkey), __pyx_t_1) < 0)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "cytoolz/dicttoolz.pyx":205 * while f(d, &pos, &pkey, &pval): * rv[pkey] = func(pval) * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "cytoolz/dicttoolz.pyx":179 * * * cpdef object valmap(object func, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Apply function to values of dictionary */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.dicttoolz.valmap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_d); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_5valmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9dicttoolz_4valmap[] = "valmap(func, d, factory=dict)\n\n Apply function to values of dictionary\n\n >>> bills = {\"Alice\": [20, 15, 30], \"Bob\": [10, 35]}\n >>> valmap(sum, bills) # doctest: +SKIP\n {'Alice': 65, 'Bob': 45}\n\n See Also:\n keymap\n itemmap\n "; static PyMethodDef __pyx_mdef_7cytoolz_9dicttoolz_5valmap = {"valmap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9dicttoolz_5valmap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9dicttoolz_4valmap}; static PyObject *__pyx_pw_7cytoolz_9dicttoolz_5valmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_func = 0; PyObject *__pyx_v_d = 0; PyObject *__pyx_v_factory = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("valmap (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_d,&__pyx_n_s_factory,0}; PyObject* values[3] = {0,0,0}; values[2] = __pyx_k__5; 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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("valmap", 0, 2, 3, 1); __PYX_ERR(0, 179, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_factory); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "valmap") < 0)) __PYX_ERR(0, 179, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; 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_func = values[0]; __pyx_v_d = values[1]; __pyx_v_factory = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("valmap", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 179, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.dicttoolz.valmap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9dicttoolz_4valmap(__pyx_self, __pyx_v_func, __pyx_v_d, __pyx_v_factory); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9dicttoolz_4valmap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_d, PyObject *__pyx_v_factory) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_7cytoolz_9dicttoolz_valmap __pyx_t_2; __Pyx_RefNannySetupContext("valmap", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.factory = __pyx_v_factory; __pyx_t_1 = __pyx_f_7cytoolz_9dicttoolz_valmap(__pyx_v_func, __pyx_v_d, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.dicttoolz.valmap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/dicttoolz.pyx":208 * * * cpdef object keymap(object func, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Apply function to keys of dictionary */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_7keymap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_keymap(PyObject *__pyx_v_func, PyObject *__pyx_v_d, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_keymap *__pyx_optional_args) { PyObject *__pyx_v_factory = __pyx_k__6; PyObject *__pyx_v_rv = 0; __pyx_t_7cytoolz_9dicttoolz_f_map_next __pyx_v_f; PyObject *__pyx_v_obj; PyObject *__pyx_v_pkey; PyObject *__pyx_v_pval; Py_ssize_t __pyx_v_pos; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __pyx_t_7cytoolz_9dicttoolz_f_map_next __pyx_t_4; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("keymap", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_factory = __pyx_optional_args->factory; } } __Pyx_INCREF(__pyx_v_d); /* "cytoolz/dicttoolz.pyx":226 * PyObject *pkey * PyObject *pval * Py_ssize_t pos = 0 # <<<<<<<<<<<<<< * * rv = factory() */ __pyx_v_pos = 0; /* "cytoolz/dicttoolz.pyx":228 * Py_ssize_t pos = 0 * * rv = factory() # <<<<<<<<<<<<<< * f = get_map_iter(d, &obj) * d = obj */ __Pyx_INCREF(__pyx_v_factory); __pyx_t_2 = __pyx_v_factory; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":229 * * rv = factory() * f = get_map_iter(d, &obj) # <<<<<<<<<<<<<< * d = obj * Py_DECREF(d) */ __pyx_t_4 = __pyx_f_7cytoolz_9dicttoolz_get_map_iter(__pyx_v_d, (&__pyx_v_obj)); if (unlikely(__pyx_t_4 == ((__pyx_t_7cytoolz_9dicttoolz_f_map_next)NULL))) __PYX_ERR(0, 229, __pyx_L1_error) __pyx_v_f = __pyx_t_4; /* "cytoolz/dicttoolz.pyx":230 * rv = factory() * f = get_map_iter(d, &obj) * d = obj # <<<<<<<<<<<<<< * Py_DECREF(d) * while f(d, &pos, &pkey, &pval): */ __pyx_t_1 = ((PyObject *)__pyx_v_obj); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_d, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":231 * f = get_map_iter(d, &obj) * d = obj * Py_DECREF(d) # <<<<<<<<<<<<<< * while f(d, &pos, &pkey, &pval): * rv[func(pkey)] = pval */ Py_DECREF(__pyx_v_d); /* "cytoolz/dicttoolz.pyx":232 * d = obj * Py_DECREF(d) * while f(d, &pos, &pkey, &pval): # <<<<<<<<<<<<<< * rv[func(pkey)] = pval * return rv */ while (1) { __pyx_t_5 = __pyx_v_f(__pyx_v_d, (&__pyx_v_pos), (&__pyx_v_pkey), (&__pyx_v_pval)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 232, __pyx_L1_error) __pyx_t_6 = (__pyx_t_5 != 0); if (!__pyx_t_6) break; /* "cytoolz/dicttoolz.pyx":233 * Py_DECREF(d) * while f(d, &pos, &pkey, &pval): * rv[func(pkey)] = pval # <<<<<<<<<<<<<< * return rv * */ __pyx_t_1 = ((PyObject *)__pyx_v_pval); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_func); __pyx_t_3 = __pyx_v_func; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, ((PyObject *)__pyx_v_pkey)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_pkey)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(PyObject_SetItem(__pyx_v_rv, __pyx_t_2, __pyx_t_1) < 0)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } /* "cytoolz/dicttoolz.pyx":234 * while f(d, &pos, &pkey, &pval): * rv[func(pkey)] = pval * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "cytoolz/dicttoolz.pyx":208 * * * cpdef object keymap(object func, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Apply function to keys of dictionary */ /* 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_AddTraceback("cytoolz.dicttoolz.keymap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_d); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_7keymap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9dicttoolz_6keymap[] = "keymap(func, d, factory=dict)\n\n Apply function to keys of dictionary\n\n >>> bills = {\"Alice\": [20, 15, 30], \"Bob\": [10, 35]}\n >>> keymap(str.lower, bills) # doctest: +SKIP\n {'alice': [20, 15, 30], 'bob': [10, 35]}\n\n See Also:\n valmap\n itemmap\n "; static PyMethodDef __pyx_mdef_7cytoolz_9dicttoolz_7keymap = {"keymap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9dicttoolz_7keymap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9dicttoolz_6keymap}; static PyObject *__pyx_pw_7cytoolz_9dicttoolz_7keymap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_func = 0; PyObject *__pyx_v_d = 0; PyObject *__pyx_v_factory = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("keymap (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_d,&__pyx_n_s_factory,0}; PyObject* values[3] = {0,0,0}; values[2] = __pyx_k__6; 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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("keymap", 0, 2, 3, 1); __PYX_ERR(0, 208, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_factory); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "keymap") < 0)) __PYX_ERR(0, 208, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; 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_func = values[0]; __pyx_v_d = values[1]; __pyx_v_factory = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("keymap", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 208, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.dicttoolz.keymap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9dicttoolz_6keymap(__pyx_self, __pyx_v_func, __pyx_v_d, __pyx_v_factory); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9dicttoolz_6keymap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_d, PyObject *__pyx_v_factory) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_7cytoolz_9dicttoolz_keymap __pyx_t_2; __Pyx_RefNannySetupContext("keymap", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.factory = __pyx_v_factory; __pyx_t_1 = __pyx_f_7cytoolz_9dicttoolz_keymap(__pyx_v_func, __pyx_v_d, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.dicttoolz.keymap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/dicttoolz.pyx":237 * * * cpdef object itemmap(object func, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Apply function to items of dictionary */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_9itemmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_itemmap(PyObject *__pyx_v_func, PyObject *__pyx_v_d, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_itemmap *__pyx_optional_args) { PyObject *__pyx_v_factory = __pyx_k__7; PyObject *__pyx_v_rv = 0; PyObject *__pyx_v_k = 0; PyObject *__pyx_v_v = 0; __pyx_t_7cytoolz_9dicttoolz_f_map_next __pyx_v_f; PyObject *__pyx_v_obj; PyObject *__pyx_v_pkey; PyObject *__pyx_v_pval; Py_ssize_t __pyx_v_pos; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __pyx_t_7cytoolz_9dicttoolz_f_map_next __pyx_t_4; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *(*__pyx_t_8)(PyObject *); __Pyx_RefNannySetupContext("itemmap", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_factory = __pyx_optional_args->factory; } } __Pyx_INCREF(__pyx_v_d); /* "cytoolz/dicttoolz.pyx":255 * PyObject *pkey * PyObject *pval * Py_ssize_t pos = 0 # <<<<<<<<<<<<<< * * rv = factory() */ __pyx_v_pos = 0; /* "cytoolz/dicttoolz.pyx":257 * Py_ssize_t pos = 0 * * rv = factory() # <<<<<<<<<<<<<< * f = get_map_iter(d, &obj) * d = obj */ __Pyx_INCREF(__pyx_v_factory); __pyx_t_2 = __pyx_v_factory; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":258 * * rv = factory() * f = get_map_iter(d, &obj) # <<<<<<<<<<<<<< * d = obj * Py_DECREF(d) */ __pyx_t_4 = __pyx_f_7cytoolz_9dicttoolz_get_map_iter(__pyx_v_d, (&__pyx_v_obj)); if (unlikely(__pyx_t_4 == ((__pyx_t_7cytoolz_9dicttoolz_f_map_next)NULL))) __PYX_ERR(0, 258, __pyx_L1_error) __pyx_v_f = __pyx_t_4; /* "cytoolz/dicttoolz.pyx":259 * rv = factory() * f = get_map_iter(d, &obj) * d = obj # <<<<<<<<<<<<<< * Py_DECREF(d) * while f(d, &pos, &pkey, &pval): */ __pyx_t_1 = ((PyObject *)__pyx_v_obj); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_d, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":260 * f = get_map_iter(d, &obj) * d = obj * Py_DECREF(d) # <<<<<<<<<<<<<< * while f(d, &pos, &pkey, &pval): * k, v = func((pkey, pval)) */ Py_DECREF(__pyx_v_d); /* "cytoolz/dicttoolz.pyx":261 * d = obj * Py_DECREF(d) * while f(d, &pos, &pkey, &pval): # <<<<<<<<<<<<<< * k, v = func((pkey, pval)) * rv[k] = v */ while (1) { __pyx_t_5 = __pyx_v_f(__pyx_v_d, (&__pyx_v_pos), (&__pyx_v_pkey), (&__pyx_v_pval)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 261, __pyx_L1_error) __pyx_t_6 = (__pyx_t_5 != 0); if (!__pyx_t_6) break; /* "cytoolz/dicttoolz.pyx":262 * Py_DECREF(d) * while f(d, &pos, &pkey, &pval): * k, v = func((pkey, pval)) # <<<<<<<<<<<<<< * rv[k] = v * return rv */ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_v_pkey)); __Pyx_GIVEREF(((PyObject *)__pyx_v_pkey)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_pkey)); __Pyx_INCREF(((PyObject *)__pyx_v_pval)); __Pyx_GIVEREF(((PyObject *)__pyx_v_pval)); PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_pval)); __Pyx_INCREF(__pyx_v_func); __pyx_t_3 = __pyx_v_func; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __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; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 262, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 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_ERR(0, 262, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __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_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __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_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L5_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_L5_unpacking_failed; __Pyx_GOTREF(__pyx_t_2); if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 262, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_unpacking_done; __pyx_L5_unpacking_failed:; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 262, __pyx_L1_error) __pyx_L6_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":263 * while f(d, &pos, &pkey, &pval): * k, v = func((pkey, pval)) * rv[k] = v # <<<<<<<<<<<<<< * return rv * */ if (unlikely(PyObject_SetItem(__pyx_v_rv, __pyx_v_k, __pyx_v_v) < 0)) __PYX_ERR(0, 263, __pyx_L1_error) } /* "cytoolz/dicttoolz.pyx":264 * k, v = func((pkey, pval)) * rv[k] = v * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "cytoolz/dicttoolz.pyx":237 * * * cpdef object itemmap(object func, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Apply function to items of dictionary */ /* 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_AddTraceback("cytoolz.dicttoolz.itemmap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF(__pyx_v_v); __Pyx_XDECREF(__pyx_v_d); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_9itemmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9dicttoolz_8itemmap[] = "itemmap(func, d, factory=dict)\n\n Apply function to items of dictionary\n\n >>> accountids = {\"Alice\": 10, \"Bob\": 20}\n >>> itemmap(reversed, accountids) # doctest: +SKIP\n {10: \"Alice\", 20: \"Bob\"}\n\n See Also:\n keymap\n valmap\n "; static PyMethodDef __pyx_mdef_7cytoolz_9dicttoolz_9itemmap = {"itemmap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9dicttoolz_9itemmap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9dicttoolz_8itemmap}; static PyObject *__pyx_pw_7cytoolz_9dicttoolz_9itemmap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_func = 0; PyObject *__pyx_v_d = 0; PyObject *__pyx_v_factory = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("itemmap (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_d,&__pyx_n_s_factory,0}; PyObject* values[3] = {0,0,0}; values[2] = __pyx_k__7; 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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("itemmap", 0, 2, 3, 1); __PYX_ERR(0, 237, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_factory); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "itemmap") < 0)) __PYX_ERR(0, 237, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; 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_func = values[0]; __pyx_v_d = values[1]; __pyx_v_factory = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("itemmap", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 237, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.dicttoolz.itemmap", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9dicttoolz_8itemmap(__pyx_self, __pyx_v_func, __pyx_v_d, __pyx_v_factory); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9dicttoolz_8itemmap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_d, PyObject *__pyx_v_factory) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_7cytoolz_9dicttoolz_itemmap __pyx_t_2; __Pyx_RefNannySetupContext("itemmap", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.factory = __pyx_v_factory; __pyx_t_1 = __pyx_f_7cytoolz_9dicttoolz_itemmap(__pyx_v_func, __pyx_v_d, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.dicttoolz.itemmap", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/dicttoolz.pyx":267 * * * cpdef object valfilter(object predicate, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Filter items in dictionary by value */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_11valfilter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_valfilter(PyObject *__pyx_v_predicate, PyObject *__pyx_v_d, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_valfilter *__pyx_optional_args) { PyObject *__pyx_v_factory = __pyx_k__8; PyObject *__pyx_v_rv = 0; __pyx_t_7cytoolz_9dicttoolz_f_map_next __pyx_v_f; PyObject *__pyx_v_obj; PyObject *__pyx_v_pkey; PyObject *__pyx_v_pval; Py_ssize_t __pyx_v_pos; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __pyx_t_7cytoolz_9dicttoolz_f_map_next __pyx_t_4; int __pyx_t_5; int __pyx_t_6; __Pyx_RefNannySetupContext("valfilter", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_factory = __pyx_optional_args->factory; } } __Pyx_INCREF(__pyx_v_d); /* "cytoolz/dicttoolz.pyx":287 * PyObject *pkey * PyObject *pval * Py_ssize_t pos = 0 # <<<<<<<<<<<<<< * * rv = factory() */ __pyx_v_pos = 0; /* "cytoolz/dicttoolz.pyx":289 * Py_ssize_t pos = 0 * * rv = factory() # <<<<<<<<<<<<<< * f = get_map_iter(d, &obj) * d = obj */ __Pyx_INCREF(__pyx_v_factory); __pyx_t_2 = __pyx_v_factory; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":290 * * rv = factory() * f = get_map_iter(d, &obj) # <<<<<<<<<<<<<< * d = obj * Py_DECREF(d) */ __pyx_t_4 = __pyx_f_7cytoolz_9dicttoolz_get_map_iter(__pyx_v_d, (&__pyx_v_obj)); if (unlikely(__pyx_t_4 == ((__pyx_t_7cytoolz_9dicttoolz_f_map_next)NULL))) __PYX_ERR(0, 290, __pyx_L1_error) __pyx_v_f = __pyx_t_4; /* "cytoolz/dicttoolz.pyx":291 * rv = factory() * f = get_map_iter(d, &obj) * d = obj # <<<<<<<<<<<<<< * Py_DECREF(d) * while f(d, &pos, &pkey, &pval): */ __pyx_t_1 = ((PyObject *)__pyx_v_obj); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_d, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":292 * f = get_map_iter(d, &obj) * d = obj * Py_DECREF(d) # <<<<<<<<<<<<<< * while f(d, &pos, &pkey, &pval): * if predicate(pval): */ Py_DECREF(__pyx_v_d); /* "cytoolz/dicttoolz.pyx":293 * d = obj * Py_DECREF(d) * while f(d, &pos, &pkey, &pval): # <<<<<<<<<<<<<< * if predicate(pval): * rv[pkey] = pval */ while (1) { __pyx_t_5 = __pyx_v_f(__pyx_v_d, (&__pyx_v_pos), (&__pyx_v_pkey), (&__pyx_v_pval)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 293, __pyx_L1_error) __pyx_t_6 = (__pyx_t_5 != 0); if (!__pyx_t_6) break; /* "cytoolz/dicttoolz.pyx":294 * Py_DECREF(d) * while f(d, &pos, &pkey, &pval): * if predicate(pval): # <<<<<<<<<<<<<< * rv[pkey] = pval * return rv */ __Pyx_INCREF(__pyx_v_predicate); __pyx_t_2 = __pyx_v_predicate; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_pval)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_pval)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { /* "cytoolz/dicttoolz.pyx":295 * while f(d, &pos, &pkey, &pval): * if predicate(pval): * rv[pkey] = pval # <<<<<<<<<<<<<< * return rv * */ __pyx_t_1 = ((PyObject *)__pyx_v_pval); __Pyx_INCREF(__pyx_t_1); if (unlikely(PyObject_SetItem(__pyx_v_rv, ((PyObject *)__pyx_v_pkey), __pyx_t_1) < 0)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":294 * Py_DECREF(d) * while f(d, &pos, &pkey, &pval): * if predicate(pval): # <<<<<<<<<<<<<< * rv[pkey] = pval * return rv */ } } /* "cytoolz/dicttoolz.pyx":296 * if predicate(pval): * rv[pkey] = pval * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "cytoolz/dicttoolz.pyx":267 * * * cpdef object valfilter(object predicate, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Filter items in dictionary by value */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.dicttoolz.valfilter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_d); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_11valfilter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9dicttoolz_10valfilter[] = "valfilter(predicate, d, factory=dict)\n\n Filter items in dictionary by value\n\n >>> iseven = lambda x: x % 2 == 0\n >>> d = {1: 2, 2: 3, 3: 4, 4: 5}\n >>> valfilter(iseven, d)\n {1: 2, 3: 4}\n\n See Also:\n keyfilter\n itemfilter\n valmap\n "; static PyMethodDef __pyx_mdef_7cytoolz_9dicttoolz_11valfilter = {"valfilter", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9dicttoolz_11valfilter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9dicttoolz_10valfilter}; static PyObject *__pyx_pw_7cytoolz_9dicttoolz_11valfilter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_predicate = 0; PyObject *__pyx_v_d = 0; PyObject *__pyx_v_factory = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("valfilter (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_predicate,&__pyx_n_s_d,&__pyx_n_s_factory,0}; PyObject* values[3] = {0,0,0}; values[2] = __pyx_k__8; 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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_predicate)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("valfilter", 0, 2, 3, 1); __PYX_ERR(0, 267, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_factory); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "valfilter") < 0)) __PYX_ERR(0, 267, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; 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_predicate = values[0]; __pyx_v_d = values[1]; __pyx_v_factory = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("valfilter", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 267, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.dicttoolz.valfilter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9dicttoolz_10valfilter(__pyx_self, __pyx_v_predicate, __pyx_v_d, __pyx_v_factory); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9dicttoolz_10valfilter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_predicate, PyObject *__pyx_v_d, PyObject *__pyx_v_factory) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_7cytoolz_9dicttoolz_valfilter __pyx_t_2; __Pyx_RefNannySetupContext("valfilter", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.factory = __pyx_v_factory; __pyx_t_1 = __pyx_f_7cytoolz_9dicttoolz_valfilter(__pyx_v_predicate, __pyx_v_d, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.dicttoolz.valfilter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/dicttoolz.pyx":299 * * * cpdef object keyfilter(object predicate, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Filter items in dictionary by key */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_13keyfilter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_keyfilter(PyObject *__pyx_v_predicate, PyObject *__pyx_v_d, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_keyfilter *__pyx_optional_args) { PyObject *__pyx_v_factory = __pyx_k__9; PyObject *__pyx_v_rv = 0; __pyx_t_7cytoolz_9dicttoolz_f_map_next __pyx_v_f; PyObject *__pyx_v_obj; PyObject *__pyx_v_pkey; PyObject *__pyx_v_pval; Py_ssize_t __pyx_v_pos; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __pyx_t_7cytoolz_9dicttoolz_f_map_next __pyx_t_4; int __pyx_t_5; int __pyx_t_6; __Pyx_RefNannySetupContext("keyfilter", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_factory = __pyx_optional_args->factory; } } __Pyx_INCREF(__pyx_v_d); /* "cytoolz/dicttoolz.pyx":319 * PyObject *pkey * PyObject *pval * Py_ssize_t pos = 0 # <<<<<<<<<<<<<< * * rv = factory() */ __pyx_v_pos = 0; /* "cytoolz/dicttoolz.pyx":321 * Py_ssize_t pos = 0 * * rv = factory() # <<<<<<<<<<<<<< * f = get_map_iter(d, &obj) * d = obj */ __Pyx_INCREF(__pyx_v_factory); __pyx_t_2 = __pyx_v_factory; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":322 * * rv = factory() * f = get_map_iter(d, &obj) # <<<<<<<<<<<<<< * d = obj * Py_DECREF(d) */ __pyx_t_4 = __pyx_f_7cytoolz_9dicttoolz_get_map_iter(__pyx_v_d, (&__pyx_v_obj)); if (unlikely(__pyx_t_4 == ((__pyx_t_7cytoolz_9dicttoolz_f_map_next)NULL))) __PYX_ERR(0, 322, __pyx_L1_error) __pyx_v_f = __pyx_t_4; /* "cytoolz/dicttoolz.pyx":323 * rv = factory() * f = get_map_iter(d, &obj) * d = obj # <<<<<<<<<<<<<< * Py_DECREF(d) * while f(d, &pos, &pkey, &pval): */ __pyx_t_1 = ((PyObject *)__pyx_v_obj); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_d, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":324 * f = get_map_iter(d, &obj) * d = obj * Py_DECREF(d) # <<<<<<<<<<<<<< * while f(d, &pos, &pkey, &pval): * if predicate(pkey): */ Py_DECREF(__pyx_v_d); /* "cytoolz/dicttoolz.pyx":325 * d = obj * Py_DECREF(d) * while f(d, &pos, &pkey, &pval): # <<<<<<<<<<<<<< * if predicate(pkey): * rv[pkey] = pval */ while (1) { __pyx_t_5 = __pyx_v_f(__pyx_v_d, (&__pyx_v_pos), (&__pyx_v_pkey), (&__pyx_v_pval)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 325, __pyx_L1_error) __pyx_t_6 = (__pyx_t_5 != 0); if (!__pyx_t_6) break; /* "cytoolz/dicttoolz.pyx":326 * Py_DECREF(d) * while f(d, &pos, &pkey, &pval): * if predicate(pkey): # <<<<<<<<<<<<<< * rv[pkey] = pval * return rv */ __Pyx_INCREF(__pyx_v_predicate); __pyx_t_2 = __pyx_v_predicate; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_v_pkey)) : __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_pkey)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { /* "cytoolz/dicttoolz.pyx":327 * while f(d, &pos, &pkey, &pval): * if predicate(pkey): * rv[pkey] = pval # <<<<<<<<<<<<<< * return rv * */ __pyx_t_1 = ((PyObject *)__pyx_v_pval); __Pyx_INCREF(__pyx_t_1); if (unlikely(PyObject_SetItem(__pyx_v_rv, ((PyObject *)__pyx_v_pkey), __pyx_t_1) < 0)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":326 * Py_DECREF(d) * while f(d, &pos, &pkey, &pval): * if predicate(pkey): # <<<<<<<<<<<<<< * rv[pkey] = pval * return rv */ } } /* "cytoolz/dicttoolz.pyx":328 * if predicate(pkey): * rv[pkey] = pval * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "cytoolz/dicttoolz.pyx":299 * * * cpdef object keyfilter(object predicate, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Filter items in dictionary by key */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.dicttoolz.keyfilter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_d); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_13keyfilter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9dicttoolz_12keyfilter[] = "keyfilter(predicate, d, factory=dict)\n\n Filter items in dictionary by key\n\n >>> iseven = lambda x: x % 2 == 0\n >>> d = {1: 2, 2: 3, 3: 4, 4: 5}\n >>> keyfilter(iseven, d)\n {2: 3, 4: 5}\n\n See Also:\n valfilter\n itemfilter\n keymap\n "; static PyMethodDef __pyx_mdef_7cytoolz_9dicttoolz_13keyfilter = {"keyfilter", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9dicttoolz_13keyfilter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9dicttoolz_12keyfilter}; static PyObject *__pyx_pw_7cytoolz_9dicttoolz_13keyfilter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_predicate = 0; PyObject *__pyx_v_d = 0; PyObject *__pyx_v_factory = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("keyfilter (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_predicate,&__pyx_n_s_d,&__pyx_n_s_factory,0}; PyObject* values[3] = {0,0,0}; values[2] = __pyx_k__9; 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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_predicate)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("keyfilter", 0, 2, 3, 1); __PYX_ERR(0, 299, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_factory); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "keyfilter") < 0)) __PYX_ERR(0, 299, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; 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_predicate = values[0]; __pyx_v_d = values[1]; __pyx_v_factory = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("keyfilter", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 299, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.dicttoolz.keyfilter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9dicttoolz_12keyfilter(__pyx_self, __pyx_v_predicate, __pyx_v_d, __pyx_v_factory); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9dicttoolz_12keyfilter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_predicate, PyObject *__pyx_v_d, PyObject *__pyx_v_factory) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_7cytoolz_9dicttoolz_keyfilter __pyx_t_2; __Pyx_RefNannySetupContext("keyfilter", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.factory = __pyx_v_factory; __pyx_t_1 = __pyx_f_7cytoolz_9dicttoolz_keyfilter(__pyx_v_predicate, __pyx_v_d, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.dicttoolz.keyfilter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/dicttoolz.pyx":331 * * * cpdef object itemfilter(object predicate, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Filter items in dictionary by item */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_15itemfilter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_itemfilter(PyObject *__pyx_v_predicate, PyObject *__pyx_v_d, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_itemfilter *__pyx_optional_args) { PyObject *__pyx_v_factory = __pyx_k__10; PyObject *__pyx_v_rv = 0; PyObject *__pyx_v_k = 0; PyObject *__pyx_v_v = 0; __pyx_t_7cytoolz_9dicttoolz_f_map_next __pyx_v_f; PyObject *__pyx_v_obj; PyObject *__pyx_v_pkey; PyObject *__pyx_v_pval; Py_ssize_t __pyx_v_pos; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __pyx_t_7cytoolz_9dicttoolz_f_map_next __pyx_t_4; int __pyx_t_5; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("itemfilter", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_factory = __pyx_optional_args->factory; } } __Pyx_INCREF(__pyx_v_d); /* "cytoolz/dicttoolz.pyx":354 * PyObject *pkey * PyObject *pval * Py_ssize_t pos = 0 # <<<<<<<<<<<<<< * * rv = factory() */ __pyx_v_pos = 0; /* "cytoolz/dicttoolz.pyx":356 * Py_ssize_t pos = 0 * * rv = factory() # <<<<<<<<<<<<<< * f = get_map_iter(d, &obj) * d = obj */ __Pyx_INCREF(__pyx_v_factory); __pyx_t_2 = __pyx_v_factory; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":357 * * rv = factory() * f = get_map_iter(d, &obj) # <<<<<<<<<<<<<< * d = obj * Py_DECREF(d) */ __pyx_t_4 = __pyx_f_7cytoolz_9dicttoolz_get_map_iter(__pyx_v_d, (&__pyx_v_obj)); if (unlikely(__pyx_t_4 == ((__pyx_t_7cytoolz_9dicttoolz_f_map_next)NULL))) __PYX_ERR(0, 357, __pyx_L1_error) __pyx_v_f = __pyx_t_4; /* "cytoolz/dicttoolz.pyx":358 * rv = factory() * f = get_map_iter(d, &obj) * d = obj # <<<<<<<<<<<<<< * Py_DECREF(d) * while f(d, &pos, &pkey, &pval): */ __pyx_t_1 = ((PyObject *)__pyx_v_obj); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_d, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":359 * f = get_map_iter(d, &obj) * d = obj * Py_DECREF(d) # <<<<<<<<<<<<<< * while f(d, &pos, &pkey, &pval): * k = pkey */ Py_DECREF(__pyx_v_d); /* "cytoolz/dicttoolz.pyx":360 * d = obj * Py_DECREF(d) * while f(d, &pos, &pkey, &pval): # <<<<<<<<<<<<<< * k = pkey * v = pval */ while (1) { __pyx_t_5 = __pyx_v_f(__pyx_v_d, (&__pyx_v_pos), (&__pyx_v_pkey), (&__pyx_v_pval)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 360, __pyx_L1_error) __pyx_t_6 = (__pyx_t_5 != 0); if (!__pyx_t_6) break; /* "cytoolz/dicttoolz.pyx":361 * Py_DECREF(d) * while f(d, &pos, &pkey, &pval): * k = pkey # <<<<<<<<<<<<<< * v = pval * if predicate((k, v)): */ __pyx_t_1 = ((PyObject *)__pyx_v_pkey); __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":362 * while f(d, &pos, &pkey, &pval): * k = pkey * v = pval # <<<<<<<<<<<<<< * if predicate((k, v)): * rv[k] = v */ __pyx_t_1 = ((PyObject *)__pyx_v_pval); __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":363 * k = pkey * v = pval * if predicate((k, v)): # <<<<<<<<<<<<<< * rv[k] = v * return rv */ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_k); __Pyx_GIVEREF(__pyx_v_k); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_k); __Pyx_INCREF(__pyx_v_v); __Pyx_GIVEREF(__pyx_v_v); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_v); __Pyx_INCREF(__pyx_v_predicate); __pyx_t_3 = __pyx_v_predicate; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { /* "cytoolz/dicttoolz.pyx":364 * v = pval * if predicate((k, v)): * rv[k] = v # <<<<<<<<<<<<<< * return rv * */ if (unlikely(PyObject_SetItem(__pyx_v_rv, __pyx_v_k, __pyx_v_v) < 0)) __PYX_ERR(0, 364, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":363 * k = pkey * v = pval * if predicate((k, v)): # <<<<<<<<<<<<<< * rv[k] = v * return rv */ } } /* "cytoolz/dicttoolz.pyx":365 * if predicate((k, v)): * rv[k] = v * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "cytoolz/dicttoolz.pyx":331 * * * cpdef object itemfilter(object predicate, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Filter items in dictionary by item */ /* 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_AddTraceback("cytoolz.dicttoolz.itemfilter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_k); __Pyx_XDECREF(__pyx_v_v); __Pyx_XDECREF(__pyx_v_d); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_15itemfilter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9dicttoolz_14itemfilter[] = "itemfilter(predicate, d, factory=dict)\n\n Filter items in dictionary by item\n\n >>> def isvalid(item):\n ... k, v = item\n ... return k % 2 == 0 and v < 4\n\n >>> d = {1: 2, 2: 3, 3: 4, 4: 5}\n >>> itemfilter(isvalid, d)\n {2: 3}\n\n See Also:\n keyfilter\n valfilter\n itemmap\n "; static PyMethodDef __pyx_mdef_7cytoolz_9dicttoolz_15itemfilter = {"itemfilter", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9dicttoolz_15itemfilter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9dicttoolz_14itemfilter}; static PyObject *__pyx_pw_7cytoolz_9dicttoolz_15itemfilter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_predicate = 0; PyObject *__pyx_v_d = 0; PyObject *__pyx_v_factory = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("itemfilter (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_predicate,&__pyx_n_s_d,&__pyx_n_s_factory,0}; PyObject* values[3] = {0,0,0}; values[2] = __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 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_predicate)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("itemfilter", 0, 2, 3, 1); __PYX_ERR(0, 331, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_factory); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "itemfilter") < 0)) __PYX_ERR(0, 331, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; 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_predicate = values[0]; __pyx_v_d = values[1]; __pyx_v_factory = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("itemfilter", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 331, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.dicttoolz.itemfilter", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9dicttoolz_14itemfilter(__pyx_self, __pyx_v_predicate, __pyx_v_d, __pyx_v_factory); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9dicttoolz_14itemfilter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_predicate, PyObject *__pyx_v_d, PyObject *__pyx_v_factory) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_7cytoolz_9dicttoolz_itemfilter __pyx_t_2; __Pyx_RefNannySetupContext("itemfilter", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.factory = __pyx_v_factory; __pyx_t_1 = __pyx_f_7cytoolz_9dicttoolz_itemfilter(__pyx_v_predicate, __pyx_v_d, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.dicttoolz.itemfilter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/dicttoolz.pyx":368 * * * cpdef object assoc(object d, object key, object value, object factory=dict): # <<<<<<<<<<<<<< * """ * Return a new dict with new key value pair */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_17assoc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_assoc(PyObject *__pyx_v_d, PyObject *__pyx_v_key, PyObject *__pyx_v_value, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_assoc *__pyx_optional_args) { PyObject *__pyx_v_factory = __pyx_k__11; PyObject *__pyx_v_rv = 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; __Pyx_RefNannySetupContext("assoc", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_factory = __pyx_optional_args->factory; } } /* "cytoolz/dicttoolz.pyx":380 * """ * cdef object rv * rv = factory() # <<<<<<<<<<<<<< * if PyDict_CheckExact(rv): * PyDict_Update(rv, d) */ __Pyx_INCREF(__pyx_v_factory); __pyx_t_2 = __pyx_v_factory; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":381 * cdef object rv * rv = factory() * if PyDict_CheckExact(rv): # <<<<<<<<<<<<<< * PyDict_Update(rv, d) * else: */ __pyx_t_4 = (PyDict_CheckExact(__pyx_v_rv) != 0); if (__pyx_t_4) { /* "cytoolz/dicttoolz.pyx":382 * rv = factory() * if PyDict_CheckExact(rv): * PyDict_Update(rv, d) # <<<<<<<<<<<<<< * else: * rv.update(d) */ __pyx_t_5 = PyDict_Update(__pyx_v_rv, __pyx_v_d); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 382, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":381 * cdef object rv * rv = factory() * if PyDict_CheckExact(rv): # <<<<<<<<<<<<<< * PyDict_Update(rv, d) * else: */ goto __pyx_L3; } /* "cytoolz/dicttoolz.pyx":384 * PyDict_Update(rv, d) * else: * rv.update(d) # <<<<<<<<<<<<<< * rv[key] = value * return rv */ /*else*/ { __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rv, __pyx_n_s_update); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_d) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_d); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __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; } __pyx_L3:; /* "cytoolz/dicttoolz.pyx":385 * else: * rv.update(d) * rv[key] = value # <<<<<<<<<<<<<< * return rv * */ if (unlikely(PyObject_SetItem(__pyx_v_rv, __pyx_v_key, __pyx_v_value) < 0)) __PYX_ERR(0, 385, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":386 * rv.update(d) * rv[key] = value * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "cytoolz/dicttoolz.pyx":368 * * * cpdef object assoc(object d, object key, object value, object factory=dict): # <<<<<<<<<<<<<< * """ * Return a new dict with new key value pair */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.dicttoolz.assoc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_17assoc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9dicttoolz_16assoc[] = "assoc(d, key, value, factory=dict)\n\n Return a new dict with new key value pair\n\n New dict has d[key] set to value. Does not modify the initial dictionary.\n\n >>> assoc({'x': 1}, 'x', 2)\n {'x': 2}\n >>> assoc({'x': 1}, 'y', 3) # doctest: +SKIP\n {'x': 1, 'y': 3}\n "; static PyMethodDef __pyx_mdef_7cytoolz_9dicttoolz_17assoc = {"assoc", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9dicttoolz_17assoc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9dicttoolz_16assoc}; static PyObject *__pyx_pw_7cytoolz_9dicttoolz_17assoc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_d = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_factory = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("assoc (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_d,&__pyx_n_s_key,&__pyx_n_s_value,&__pyx_n_s_factory,0}; PyObject* values[4] = {0,0,0,0}; values[3] = __pyx_k__11; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("assoc", 0, 3, 4, 1); __PYX_ERR(0, 368, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("assoc", 0, 3, 4, 2); __PYX_ERR(0, 368, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_factory); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assoc") < 0)) __PYX_ERR(0, 368, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; 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_d = values[0]; __pyx_v_key = values[1]; __pyx_v_value = values[2]; __pyx_v_factory = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("assoc", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 368, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.dicttoolz.assoc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9dicttoolz_16assoc(__pyx_self, __pyx_v_d, __pyx_v_key, __pyx_v_value, __pyx_v_factory); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9dicttoolz_16assoc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_d, PyObject *__pyx_v_key, PyObject *__pyx_v_value, PyObject *__pyx_v_factory) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_7cytoolz_9dicttoolz_assoc __pyx_t_2; __Pyx_RefNannySetupContext("assoc", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.factory = __pyx_v_factory; __pyx_t_1 = __pyx_f_7cytoolz_9dicttoolz_assoc(__pyx_v_d, __pyx_v_key, __pyx_v_value, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.dicttoolz.assoc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/dicttoolz.pyx":389 * * * cpdef object assoc_in(object d, object keys, object value, object factory=dict): # <<<<<<<<<<<<<< * """ * Return a new dict with new, potentially nested, key value pair */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_19assoc_in(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_assoc_in(PyObject *__pyx_v_d, PyObject *__pyx_v_keys, PyObject *__pyx_v_value, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_assoc_in *__pyx_optional_args) { PyObject *__pyx_v_factory = __pyx_k__12; PyObject *__pyx_v_prevkey = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_rv = 0; PyObject *__pyx_v_inner = 0; PyObject *__pyx_v_dtemp = 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; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; PyObject *__pyx_t_9 = NULL; __Pyx_RefNannySetupContext("assoc_in", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_factory = __pyx_optional_args->factory; } } __Pyx_INCREF(__pyx_v_d); __Pyx_INCREF(__pyx_v_keys); /* "cytoolz/dicttoolz.pyx":404 * cdef object prevkey, key * cdef object rv, inner, dtemp * prevkey, keys = keys[0], keys[1:] # <<<<<<<<<<<<<< * rv = factory() * if PyDict_CheckExact(rv): */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_keys, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_keys, 1, 0, NULL, NULL, &__pyx_slice__13, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_prevkey = __pyx_t_1; __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_keys, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":405 * cdef object rv, inner, dtemp * prevkey, keys = keys[0], keys[1:] * rv = factory() # <<<<<<<<<<<<<< * if PyDict_CheckExact(rv): * PyDict_Update(rv, d) */ __Pyx_INCREF(__pyx_v_factory); __pyx_t_1 = __pyx_v_factory; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_rv = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":406 * prevkey, keys = keys[0], keys[1:] * rv = factory() * if PyDict_CheckExact(rv): # <<<<<<<<<<<<<< * PyDict_Update(rv, d) * else: */ __pyx_t_4 = (PyDict_CheckExact(__pyx_v_rv) != 0); if (__pyx_t_4) { /* "cytoolz/dicttoolz.pyx":407 * rv = factory() * if PyDict_CheckExact(rv): * PyDict_Update(rv, d) # <<<<<<<<<<<<<< * else: * rv.update(d) */ __pyx_t_5 = PyDict_Update(__pyx_v_rv, __pyx_v_d); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 407, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":406 * prevkey, keys = keys[0], keys[1:] * rv = factory() * if PyDict_CheckExact(rv): # <<<<<<<<<<<<<< * PyDict_Update(rv, d) * else: */ goto __pyx_L3; } /* "cytoolz/dicttoolz.pyx":409 * PyDict_Update(rv, d) * else: * rv.update(d) # <<<<<<<<<<<<<< * inner = rv * */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rv, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_d) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_d); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __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; } __pyx_L3:; /* "cytoolz/dicttoolz.pyx":410 * else: * rv.update(d) * inner = rv # <<<<<<<<<<<<<< * * for key in keys: */ __Pyx_INCREF(__pyx_v_rv); __pyx_v_inner = __pyx_v_rv; /* "cytoolz/dicttoolz.pyx":412 * inner = rv * * for key in keys: # <<<<<<<<<<<<<< * if prevkey in d: * d = d[prevkey] */ if (likely(PyList_CheckExact(__pyx_v_keys)) || PyTuple_CheckExact(__pyx_v_keys)) { __pyx_t_2 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 412, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 412, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 412, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 412, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":413 * * for key in keys: * if prevkey in d: # <<<<<<<<<<<<<< * d = d[prevkey] * dtemp = factory() */ __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_prevkey, __pyx_v_d, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 413, __pyx_L1_error) __pyx_t_8 = (__pyx_t_4 != 0); if (__pyx_t_8) { /* "cytoolz/dicttoolz.pyx":414 * for key in keys: * if prevkey in d: * d = d[prevkey] # <<<<<<<<<<<<<< * dtemp = factory() * if PyDict_CheckExact(dtemp): */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_d, __pyx_v_prevkey); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_d, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":415 * if prevkey in d: * d = d[prevkey] * dtemp = factory() # <<<<<<<<<<<<<< * if PyDict_CheckExact(dtemp): * PyDict_Update(dtemp, d) */ __Pyx_INCREF(__pyx_v_factory); __pyx_t_3 = __pyx_v_factory; __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_dtemp, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":416 * d = d[prevkey] * dtemp = factory() * if PyDict_CheckExact(dtemp): # <<<<<<<<<<<<<< * PyDict_Update(dtemp, d) * else: */ __pyx_t_8 = (PyDict_CheckExact(__pyx_v_dtemp) != 0); if (__pyx_t_8) { /* "cytoolz/dicttoolz.pyx":417 * dtemp = factory() * if PyDict_CheckExact(dtemp): * PyDict_Update(dtemp, d) # <<<<<<<<<<<<<< * else: * dtemp.update(d) */ __pyx_t_5 = PyDict_Update(__pyx_v_dtemp, __pyx_v_d); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 417, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":416 * d = d[prevkey] * dtemp = factory() * if PyDict_CheckExact(dtemp): # <<<<<<<<<<<<<< * PyDict_Update(dtemp, d) * else: */ goto __pyx_L7; } /* "cytoolz/dicttoolz.pyx":419 * PyDict_Update(dtemp, d) * else: * dtemp.update(d) # <<<<<<<<<<<<<< * else: * d = factory() */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtemp, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_v_d) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_d); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 419, __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_L7:; /* "cytoolz/dicttoolz.pyx":413 * * for key in keys: * if prevkey in d: # <<<<<<<<<<<<<< * d = d[prevkey] * dtemp = factory() */ goto __pyx_L6; } /* "cytoolz/dicttoolz.pyx":421 * dtemp.update(d) * else: * d = factory() # <<<<<<<<<<<<<< * dtemp = d * inner[prevkey] = dtemp */ /*else*/ { __Pyx_INCREF(__pyx_v_factory); __pyx_t_3 = __pyx_v_factory; __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_d, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":422 * else: * d = factory() * dtemp = d # <<<<<<<<<<<<<< * inner[prevkey] = dtemp * prevkey = key */ __Pyx_INCREF(__pyx_v_d); __Pyx_XDECREF_SET(__pyx_v_dtemp, __pyx_v_d); } __pyx_L6:; /* "cytoolz/dicttoolz.pyx":423 * d = factory() * dtemp = d * inner[prevkey] = dtemp # <<<<<<<<<<<<<< * prevkey = key * inner = dtemp */ if (unlikely(PyObject_SetItem(__pyx_v_inner, __pyx_v_prevkey, __pyx_v_dtemp) < 0)) __PYX_ERR(0, 423, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":424 * dtemp = d * inner[prevkey] = dtemp * prevkey = key # <<<<<<<<<<<<<< * inner = dtemp * */ __Pyx_INCREF(__pyx_v_key); __Pyx_DECREF_SET(__pyx_v_prevkey, __pyx_v_key); /* "cytoolz/dicttoolz.pyx":425 * inner[prevkey] = dtemp * prevkey = key * inner = dtemp # <<<<<<<<<<<<<< * * inner[prevkey] = value */ __Pyx_INCREF(__pyx_v_dtemp); __Pyx_DECREF_SET(__pyx_v_inner, __pyx_v_dtemp); /* "cytoolz/dicttoolz.pyx":412 * inner = rv * * for key in keys: # <<<<<<<<<<<<<< * if prevkey in d: * d = d[prevkey] */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":427 * inner = dtemp * * inner[prevkey] = value # <<<<<<<<<<<<<< * return rv * */ if (unlikely(PyObject_SetItem(__pyx_v_inner, __pyx_v_prevkey, __pyx_v_value) < 0)) __PYX_ERR(0, 427, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":428 * * inner[prevkey] = value * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "cytoolz/dicttoolz.pyx":389 * * * cpdef object assoc_in(object d, object keys, object value, object factory=dict): # <<<<<<<<<<<<<< * """ * Return a new dict with new, potentially nested, key value pair */ /* 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_9); __Pyx_AddTraceback("cytoolz.dicttoolz.assoc_in", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prevkey); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_inner); __Pyx_XDECREF(__pyx_v_dtemp); __Pyx_XDECREF(__pyx_v_d); __Pyx_XDECREF(__pyx_v_keys); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_19assoc_in(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9dicttoolz_18assoc_in[] = "assoc_in(d, keys, value, factory=dict)\n\n Return a new dict with new, potentially nested, key value pair\n\n >>> purchase = {'name': 'Alice',\n ... 'order': {'items': ['Apple', 'Orange'],\n ... 'costs': [0.50, 1.25]},\n ... 'credit card': '5555-1234-1234-1234'}\n >>> assoc_in(purchase, ['order', 'costs'], [0.25, 1.00]) # doctest: +SKIP\n {'credit card': '5555-1234-1234-1234',\n 'name': 'Alice',\n 'order': {'costs': [0.25, 1.00], 'items': ['Apple', 'Orange']}}\n "; static PyMethodDef __pyx_mdef_7cytoolz_9dicttoolz_19assoc_in = {"assoc_in", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9dicttoolz_19assoc_in, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9dicttoolz_18assoc_in}; static PyObject *__pyx_pw_7cytoolz_9dicttoolz_19assoc_in(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_d = 0; PyObject *__pyx_v_keys = 0; PyObject *__pyx_v_value = 0; PyObject *__pyx_v_factory = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("assoc_in (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_d,&__pyx_n_s_keys,&__pyx_n_s_value,&__pyx_n_s_factory,0}; PyObject* values[4] = {0,0,0,0}; values[3] = __pyx_k__12; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("assoc_in", 0, 3, 4, 1); __PYX_ERR(0, 389, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("assoc_in", 0, 3, 4, 2); __PYX_ERR(0, 389, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_factory); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "assoc_in") < 0)) __PYX_ERR(0, 389, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; 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_d = values[0]; __pyx_v_keys = values[1]; __pyx_v_value = values[2]; __pyx_v_factory = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("assoc_in", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 389, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.dicttoolz.assoc_in", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9dicttoolz_18assoc_in(__pyx_self, __pyx_v_d, __pyx_v_keys, __pyx_v_value, __pyx_v_factory); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9dicttoolz_18assoc_in(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_d, PyObject *__pyx_v_keys, PyObject *__pyx_v_value, PyObject *__pyx_v_factory) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_7cytoolz_9dicttoolz_assoc_in __pyx_t_2; __Pyx_RefNannySetupContext("assoc_in", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.factory = __pyx_v_factory; __pyx_t_1 = __pyx_f_7cytoolz_9dicttoolz_assoc_in(__pyx_v_d, __pyx_v_keys, __pyx_v_value, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.dicttoolz.assoc_in", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/dicttoolz.pyx":431 * * * cdef object c_dissoc(object d, object keys, object factory=dict): # <<<<<<<<<<<<<< * # implementation copied from toolz. Not benchmarked. * cdef object rv */ static PyObject *__pyx_f_7cytoolz_9dicttoolz_c_dissoc(PyObject *__pyx_v_d, PyObject *__pyx_v_keys, struct __pyx_opt_args_7cytoolz_9dicttoolz_c_dissoc *__pyx_optional_args) { PyObject *__pyx_v_factory = __pyx_k__14; PyObject *__pyx_v_rv = 0; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_remaining = NULL; PyObject *__pyx_v_k = 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; Py_ssize_t __pyx_t_5; int __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_t_9; int __pyx_t_10; __Pyx_RefNannySetupContext("c_dissoc", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_factory = __pyx_optional_args->factory; } } /* "cytoolz/dicttoolz.pyx":434 * # implementation copied from toolz. Not benchmarked. * cdef object rv * rv = factory() # <<<<<<<<<<<<<< * if len(keys) < len(d) * 0.6: * rv.update(d) */ __Pyx_INCREF(__pyx_v_factory); __pyx_t_2 = __pyx_v_factory; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_rv = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":435 * cdef object rv * rv = factory() * if len(keys) < len(d) * 0.6: # <<<<<<<<<<<<<< * rv.update(d) * for key in keys: */ __pyx_t_4 = PyObject_Length(__pyx_v_keys); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 435, __pyx_L1_error) __pyx_t_5 = PyObject_Length(__pyx_v_d); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 435, __pyx_L1_error) __pyx_t_6 = ((__pyx_t_4 < (__pyx_t_5 * 0.6)) != 0); if (__pyx_t_6) { /* "cytoolz/dicttoolz.pyx":436 * rv = factory() * if len(keys) < len(d) * 0.6: * rv.update(d) # <<<<<<<<<<<<<< * for key in keys: * if key in rv: */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_rv, __pyx_n_s_update); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_d) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_d); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __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; /* "cytoolz/dicttoolz.pyx":437 * if len(keys) < len(d) * 0.6: * rv.update(d) * for key in keys: # <<<<<<<<<<<<<< * if key in rv: * del rv[key] */ if (likely(PyList_CheckExact(__pyx_v_keys)) || PyTuple_CheckExact(__pyx_v_keys)) { __pyx_t_1 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0; __pyx_t_7 = NULL; } else { __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 437, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 437, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 437, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 437, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":438 * rv.update(d) * for key in keys: * if key in rv: # <<<<<<<<<<<<<< * del rv[key] * else: */ __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_rv, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 438, __pyx_L1_error) __pyx_t_8 = (__pyx_t_6 != 0); if (__pyx_t_8) { /* "cytoolz/dicttoolz.pyx":439 * for key in keys: * if key in rv: * del rv[key] # <<<<<<<<<<<<<< * else: * remaining = set(d) */ if (unlikely(PyObject_DelItem(__pyx_v_rv, __pyx_v_key) < 0)) __PYX_ERR(0, 439, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":438 * rv.update(d) * for key in keys: * if key in rv: # <<<<<<<<<<<<<< * del rv[key] * else: */ } /* "cytoolz/dicttoolz.pyx":437 * if len(keys) < len(d) * 0.6: * rv.update(d) * for key in keys: # <<<<<<<<<<<<<< * if key in rv: * del rv[key] */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":435 * cdef object rv * rv = factory() * if len(keys) < len(d) * 0.6: # <<<<<<<<<<<<<< * rv.update(d) * for key in keys: */ goto __pyx_L3; } /* "cytoolz/dicttoolz.pyx":441 * del rv[key] * else: * remaining = set(d) # <<<<<<<<<<<<<< * remaining.difference_update(keys) * for k in remaining: */ /*else*/ { __pyx_t_1 = PySet_New(__pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_remaining = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":442 * else: * remaining = set(d) * remaining.difference_update(keys) # <<<<<<<<<<<<<< * for k in remaining: * rv[k] = d[k] */ __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_difference_update, __pyx_v_remaining, __pyx_v_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":443 * remaining = set(d) * remaining.difference_update(keys) * for k in remaining: # <<<<<<<<<<<<<< * rv[k] = d[k] * return rv */ __pyx_t_5 = 0; __pyx_t_2 = __Pyx_set_iterator(__pyx_v_remaining, 1, (&__pyx_t_4), (&__pyx_t_9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; while (1) { __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_1, __pyx_t_4, &__pyx_t_5, &__pyx_t_2, __pyx_t_9); if (unlikely(__pyx_t_10 == 0)) break; if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":444 * remaining.difference_update(keys) * for k in remaining: * rv[k] = d[k] # <<<<<<<<<<<<<< * return rv * */ __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_d, __pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (unlikely(PyObject_SetItem(__pyx_v_rv, __pyx_v_k, __pyx_t_2) < 0)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "cytoolz/dicttoolz.pyx":445 * for k in remaining: * rv[k] = d[k] * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "cytoolz/dicttoolz.pyx":431 * * * cdef object c_dissoc(object d, object keys, object factory=dict): # <<<<<<<<<<<<<< * # implementation copied from toolz. Not benchmarked. * cdef object rv */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.dicttoolz.c_dissoc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_remaining); __Pyx_XDECREF(__pyx_v_k); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/dicttoolz.pyx":448 * * * def dissoc(d, *keys, **kwargs): # <<<<<<<<<<<<<< * """ * Return a new dict with the given key(s) removed. */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_21dissoc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9dicttoolz_20dissoc[] = "dissoc(d, *keys, **kwargs)\n\n Return a new dict with the given key(s) removed.\n\n New dict has d[key] deleted for each supplied key.\n Does not modify the initial dictionary.\n\n >>> dissoc({'x': 1, 'y': 2}, 'y')\n {'x': 1}\n >>> dissoc({'x': 1, 'y': 2}, 'y', 'x')\n {}\n >>> dissoc({'x': 1}, 'y') # Ignores missing keys\n {'x': 1}\n "; static PyMethodDef __pyx_mdef_7cytoolz_9dicttoolz_21dissoc = {"dissoc", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9dicttoolz_21dissoc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9dicttoolz_20dissoc}; static PyObject *__pyx_pw_7cytoolz_9dicttoolz_21dissoc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_d = 0; PyObject *__pyx_v_keys = 0; PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("dissoc (wrapper)", 0); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); if (PyTuple_GET_SIZE(__pyx_args) > 1) { __pyx_v_keys = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); if (unlikely(!__pyx_v_keys)) { __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_keys); } else { __pyx_v_keys = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_d,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) { default: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "dissoc") < 0)) __PYX_ERR(0, 448, __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_d = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("dissoc", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 448, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_keys); __pyx_v_keys = 0; __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0; __Pyx_AddTraceback("cytoolz.dicttoolz.dissoc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9dicttoolz_20dissoc(__pyx_self, __pyx_v_d, __pyx_v_keys, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_keys); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9dicttoolz_20dissoc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_d, PyObject *__pyx_v_keys, PyObject *__pyx_v_kwargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; struct __pyx_opt_args_7cytoolz_9dicttoolz_c_dissoc __pyx_t_3; __Pyx_RefNannySetupContext("dissoc", 0); /* "cytoolz/dicttoolz.pyx":462 * {'x': 1} * """ * return c_dissoc(d, keys, get_factory('dissoc', kwargs)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9dicttoolz_get_factory(__pyx_n_s_dissoc, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3.__pyx_n = 1; __pyx_t_3.factory = __pyx_t_1; __pyx_t_2 = __pyx_f_7cytoolz_9dicttoolz_c_dissoc(__pyx_v_d, __pyx_v_keys, &__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __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; /* "cytoolz/dicttoolz.pyx":448 * * * def dissoc(d, *keys, **kwargs): # <<<<<<<<<<<<<< * """ * Return a new dict with the given key(s) removed. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.dicttoolz.dissoc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/dicttoolz.pyx":465 * * * cpdef object update_in(object d, object keys, object func, object default=None, object factory=dict): # <<<<<<<<<<<<<< * """ * Update value in a (potentially) nested dictionary */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_23update_in(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_update_in(PyObject *__pyx_v_d, PyObject *__pyx_v_keys, PyObject *__pyx_v_func, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_update_in *__pyx_optional_args) { PyObject *__pyx_v_default = ((PyObject *)Py_None); PyObject *__pyx_v_factory = __pyx_k__15; PyObject *__pyx_v_prevkey = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_rv = 0; PyObject *__pyx_v_inner = 0; PyObject *__pyx_v_dtemp = 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; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; PyObject *__pyx_t_9 = NULL; __Pyx_RefNannySetupContext("update_in", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default = __pyx_optional_args->__pyx_default; if (__pyx_optional_args->__pyx_n > 1) { __pyx_v_factory = __pyx_optional_args->factory; } } } __Pyx_INCREF(__pyx_v_d); __Pyx_INCREF(__pyx_v_keys); /* "cytoolz/dicttoolz.pyx":502 * cdef object prevkey, key * cdef object rv, inner, dtemp * prevkey, keys = keys[0], keys[1:] # <<<<<<<<<<<<<< * rv = factory() * if PyDict_CheckExact(rv): */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_keys, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_keys, 1, 0, NULL, NULL, &__pyx_slice__13, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_prevkey = __pyx_t_1; __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_keys, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":503 * cdef object rv, inner, dtemp * prevkey, keys = keys[0], keys[1:] * rv = factory() # <<<<<<<<<<<<<< * if PyDict_CheckExact(rv): * PyDict_Update(rv, d) */ __Pyx_INCREF(__pyx_v_factory); __pyx_t_1 = __pyx_v_factory; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_rv = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":504 * prevkey, keys = keys[0], keys[1:] * rv = factory() * if PyDict_CheckExact(rv): # <<<<<<<<<<<<<< * PyDict_Update(rv, d) * else: */ __pyx_t_4 = (PyDict_CheckExact(__pyx_v_rv) != 0); if (__pyx_t_4) { /* "cytoolz/dicttoolz.pyx":505 * rv = factory() * if PyDict_CheckExact(rv): * PyDict_Update(rv, d) # <<<<<<<<<<<<<< * else: * rv.update(d) */ __pyx_t_5 = PyDict_Update(__pyx_v_rv, __pyx_v_d); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 505, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":504 * prevkey, keys = keys[0], keys[1:] * rv = factory() * if PyDict_CheckExact(rv): # <<<<<<<<<<<<<< * PyDict_Update(rv, d) * else: */ goto __pyx_L3; } /* "cytoolz/dicttoolz.pyx":507 * PyDict_Update(rv, d) * else: * rv.update(d) # <<<<<<<<<<<<<< * inner = rv * */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_rv, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_d) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_d); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __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; } __pyx_L3:; /* "cytoolz/dicttoolz.pyx":508 * else: * rv.update(d) * inner = rv # <<<<<<<<<<<<<< * * for key in keys: */ __Pyx_INCREF(__pyx_v_rv); __pyx_v_inner = __pyx_v_rv; /* "cytoolz/dicttoolz.pyx":510 * inner = rv * * for key in keys: # <<<<<<<<<<<<<< * if prevkey in d: * d = d[prevkey] */ if (likely(PyList_CheckExact(__pyx_v_keys)) || PyTuple_CheckExact(__pyx_v_keys)) { __pyx_t_2 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 510, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 510, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 510, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":511 * * for key in keys: * if prevkey in d: # <<<<<<<<<<<<<< * d = d[prevkey] * dtemp = factory() */ __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_prevkey, __pyx_v_d, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 511, __pyx_L1_error) __pyx_t_8 = (__pyx_t_4 != 0); if (__pyx_t_8) { /* "cytoolz/dicttoolz.pyx":512 * for key in keys: * if prevkey in d: * d = d[prevkey] # <<<<<<<<<<<<<< * dtemp = factory() * if PyDict_CheckExact(dtemp): */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_d, __pyx_v_prevkey); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_d, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":513 * if prevkey in d: * d = d[prevkey] * dtemp = factory() # <<<<<<<<<<<<<< * if PyDict_CheckExact(dtemp): * PyDict_Update(dtemp, d) */ __Pyx_INCREF(__pyx_v_factory); __pyx_t_3 = __pyx_v_factory; __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_dtemp, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":514 * d = d[prevkey] * dtemp = factory() * if PyDict_CheckExact(dtemp): # <<<<<<<<<<<<<< * PyDict_Update(dtemp, d) * else: */ __pyx_t_8 = (PyDict_CheckExact(__pyx_v_dtemp) != 0); if (__pyx_t_8) { /* "cytoolz/dicttoolz.pyx":515 * dtemp = factory() * if PyDict_CheckExact(dtemp): * PyDict_Update(dtemp, d) # <<<<<<<<<<<<<< * else: * dtemp.update(d) */ __pyx_t_5 = PyDict_Update(__pyx_v_dtemp, __pyx_v_d); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 515, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":514 * d = d[prevkey] * dtemp = factory() * if PyDict_CheckExact(dtemp): # <<<<<<<<<<<<<< * PyDict_Update(dtemp, d) * else: */ goto __pyx_L7; } /* "cytoolz/dicttoolz.pyx":517 * PyDict_Update(dtemp, d) * else: * dtemp.update(d) # <<<<<<<<<<<<<< * else: * d = factory() */ /*else*/ { __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtemp, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_v_d) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_d); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __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_L7:; /* "cytoolz/dicttoolz.pyx":511 * * for key in keys: * if prevkey in d: # <<<<<<<<<<<<<< * d = d[prevkey] * dtemp = factory() */ goto __pyx_L6; } /* "cytoolz/dicttoolz.pyx":519 * dtemp.update(d) * else: * d = factory() # <<<<<<<<<<<<<< * dtemp = d * inner[prevkey] = dtemp */ /*else*/ { __Pyx_INCREF(__pyx_v_factory); __pyx_t_3 = __pyx_v_factory; __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_d, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/dicttoolz.pyx":520 * else: * d = factory() * dtemp = d # <<<<<<<<<<<<<< * inner[prevkey] = dtemp * prevkey = key */ __Pyx_INCREF(__pyx_v_d); __Pyx_XDECREF_SET(__pyx_v_dtemp, __pyx_v_d); } __pyx_L6:; /* "cytoolz/dicttoolz.pyx":521 * d = factory() * dtemp = d * inner[prevkey] = dtemp # <<<<<<<<<<<<<< * prevkey = key * inner = dtemp */ if (unlikely(PyObject_SetItem(__pyx_v_inner, __pyx_v_prevkey, __pyx_v_dtemp) < 0)) __PYX_ERR(0, 521, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":522 * dtemp = d * inner[prevkey] = dtemp * prevkey = key # <<<<<<<<<<<<<< * inner = dtemp * */ __Pyx_INCREF(__pyx_v_key); __Pyx_DECREF_SET(__pyx_v_prevkey, __pyx_v_key); /* "cytoolz/dicttoolz.pyx":523 * inner[prevkey] = dtemp * prevkey = key * inner = dtemp # <<<<<<<<<<<<<< * * if prevkey in d: */ __Pyx_INCREF(__pyx_v_dtemp); __Pyx_DECREF_SET(__pyx_v_inner, __pyx_v_dtemp); /* "cytoolz/dicttoolz.pyx":510 * inner = rv * * for key in keys: # <<<<<<<<<<<<<< * if prevkey in d: * d = d[prevkey] */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":525 * inner = dtemp * * if prevkey in d: # <<<<<<<<<<<<<< * key = func(d[prevkey]) * else: */ __pyx_t_8 = (__Pyx_PySequence_ContainsTF(__pyx_v_prevkey, __pyx_v_d, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 525, __pyx_L1_error) __pyx_t_4 = (__pyx_t_8 != 0); if (__pyx_t_4) { /* "cytoolz/dicttoolz.pyx":526 * * if prevkey in d: * key = func(d[prevkey]) # <<<<<<<<<<<<<< * else: * key = func(default) */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_d, __pyx_v_prevkey); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_func); __pyx_t_3 = __pyx_v_func; __pyx_t_9 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":525 * inner = dtemp * * if prevkey in d: # <<<<<<<<<<<<<< * key = func(d[prevkey]) * else: */ goto __pyx_L8; } /* "cytoolz/dicttoolz.pyx":528 * key = func(d[prevkey]) * else: * key = func(default) # <<<<<<<<<<<<<< * inner[prevkey] = key * return rv */ /*else*/ { __Pyx_INCREF(__pyx_v_func); __pyx_t_3 = __pyx_v_func; __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_default) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_default); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2); __pyx_t_2 = 0; } __pyx_L8:; /* "cytoolz/dicttoolz.pyx":529 * else: * key = func(default) * inner[prevkey] = key # <<<<<<<<<<<<<< * return rv * */ if (unlikely(PyObject_SetItem(__pyx_v_inner, __pyx_v_prevkey, __pyx_v_key) < 0)) __PYX_ERR(0, 529, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":530 * key = func(default) * inner[prevkey] = key * return rv # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_rv); __pyx_r = __pyx_v_rv; goto __pyx_L0; /* "cytoolz/dicttoolz.pyx":465 * * * cpdef object update_in(object d, object keys, object func, object default=None, object factory=dict): # <<<<<<<<<<<<<< * """ * Update value in a (potentially) nested dictionary */ /* 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_9); __Pyx_AddTraceback("cytoolz.dicttoolz.update_in", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_prevkey); __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_rv); __Pyx_XDECREF(__pyx_v_inner); __Pyx_XDECREF(__pyx_v_dtemp); __Pyx_XDECREF(__pyx_v_d); __Pyx_XDECREF(__pyx_v_keys); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_23update_in(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9dicttoolz_22update_in[] = "update_in(d, keys, func, default=None, factory=dict)\n\n Update value in a (potentially) nested dictionary\n\n inputs:\n d - dictionary on which to operate\n keys - list or tuple giving the location of the value to be changed in d\n func - function to operate on that value\n\n If keys == [k0,..,kX] and d[k0]..[kX] == v, update_in returns a copy of the\n original dictionary with v replaced by func(v), but does not mutate the\n original dictionary.\n\n If k0 is not a key in d, update_in creates nested dictionaries to the depth\n specified by the keys, with the innermost value set to func(default).\n\n >>> inc = lambda x: x + 1\n >>> update_in({'a': 0}, ['a'], inc)\n {'a': 1}\n\n >>> transaction = {'name': 'Alice',\n ... 'purchase': {'items': ['Apple', 'Orange'],\n ... 'costs': [0.50, 1.25]},\n ... 'credit card': '5555-1234-1234-1234'}\n >>> update_in(transaction, ['purchase', 'costs'], sum) # doctest: +SKIP\n {'credit card': '5555-1234-1234-1234',\n 'name': 'Alice',\n 'purchase': {'costs': 1.75, 'items': ['Apple', 'Orange']}}\n\n >>> # updating a value when k0 is not in d\n >>> update_in({}, [1, 2, 3], str, default=\"bar\")\n {1: {2: {3: 'bar'}}}\n >>> update_in({1: 'foo'}, [2, 3, 4], inc, 0)\n {1: 'foo', 2: {3: {4: 1}}}\n "; static PyMethodDef __pyx_mdef_7cytoolz_9dicttoolz_23update_in = {"update_in", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9dicttoolz_23update_in, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9dicttoolz_22update_in}; static PyObject *__pyx_pw_7cytoolz_9dicttoolz_23update_in(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_d = 0; PyObject *__pyx_v_keys = 0; PyObject *__pyx_v_func = 0; PyObject *__pyx_v_default = 0; PyObject *__pyx_v_factory = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("update_in (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_d,&__pyx_n_s_keys,&__pyx_n_s_func,&__pyx_n_s_default,&__pyx_n_s_factory,0}; PyObject* values[5] = {0,0,0,0,0}; values[3] = ((PyObject *)Py_None); values[4] = __pyx_k__15; 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); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_d)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("update_in", 0, 3, 5, 1); __PYX_ERR(0, 465, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("update_in", 0, 3, 5, 2); __PYX_ERR(0, 465, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default); if (value) { values[3] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_factory); if (value) { values[4] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update_in") < 0)) __PYX_ERR(0, 465, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; 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_d = values[0]; __pyx_v_keys = values[1]; __pyx_v_func = values[2]; __pyx_v_default = values[3]; __pyx_v_factory = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("update_in", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 465, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.dicttoolz.update_in", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9dicttoolz_22update_in(__pyx_self, __pyx_v_d, __pyx_v_keys, __pyx_v_func, __pyx_v_default, __pyx_v_factory); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9dicttoolz_22update_in(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_d, PyObject *__pyx_v_keys, PyObject *__pyx_v_func, PyObject *__pyx_v_default, PyObject *__pyx_v_factory) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_7cytoolz_9dicttoolz_update_in __pyx_t_2; __Pyx_RefNannySetupContext("update_in", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 2; __pyx_t_2.__pyx_default = __pyx_v_default; __pyx_t_2.factory = __pyx_v_factory; __pyx_t_1 = __pyx_f_7cytoolz_9dicttoolz_update_in(__pyx_v_d, __pyx_v_keys, __pyx_v_func, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.dicttoolz.update_in", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/dicttoolz.pyx":536 * * * cpdef object get_in(object keys, object coll, object default=None, object no_default=False): # <<<<<<<<<<<<<< * """ * Returns coll[i0][i1]...[iX] where [i0, i1, ..., iX]==keys. */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_25get_in(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9dicttoolz_get_in(PyObject *__pyx_v_keys, PyObject *__pyx_v_coll, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_get_in *__pyx_optional_args) { PyObject *__pyx_v_default = ((PyObject *)Py_None); PyObject *__pyx_v_no_default = ((PyObject *)Py_False); PyObject *__pyx_v_item = 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; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; int __pyx_t_10; __Pyx_RefNannySetupContext("get_in", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default = __pyx_optional_args->__pyx_default; if (__pyx_optional_args->__pyx_n > 1) { __pyx_v_no_default = __pyx_optional_args->no_default; } } } __Pyx_INCREF(__pyx_v_coll); /* "cytoolz/dicttoolz.pyx":569 * """ * cdef object item * try: # <<<<<<<<<<<<<< * for item in keys: * coll = coll[item] */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __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:*/ { /* "cytoolz/dicttoolz.pyx":570 * cdef object item * try: * for item in keys: # <<<<<<<<<<<<<< * coll = coll[item] * return coll */ if (likely(PyList_CheckExact(__pyx_v_keys)) || PyTuple_CheckExact(__pyx_v_keys)) { __pyx_t_4 = __pyx_v_keys; __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_keys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 570, __pyx_L3_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 570, __pyx_L3_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 570, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 570, __pyx_L3_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 570, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 570, __pyx_L3_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7); __pyx_t_7 = 0; /* "cytoolz/dicttoolz.pyx":571 * try: * for item in keys: * coll = coll[item] # <<<<<<<<<<<<<< * return coll * except _get_in_exceptions: */ __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_coll, __pyx_v_item); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 571, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF_SET(__pyx_v_coll, __pyx_t_7); __pyx_t_7 = 0; /* "cytoolz/dicttoolz.pyx":570 * cdef object item * try: * for item in keys: # <<<<<<<<<<<<<< * coll = coll[item] * return coll */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/dicttoolz.pyx":572 * for item in keys: * coll = coll[item] * return coll # <<<<<<<<<<<<<< * except _get_in_exceptions: * if no_default: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_coll); __pyx_r = __pyx_v_coll; goto __pyx_L7_try_return; /* "cytoolz/dicttoolz.pyx":569 * """ * cdef object item * try: # <<<<<<<<<<<<<< * for item in keys: * coll = coll[item] */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "cytoolz/dicttoolz.pyx":573 * coll = coll[item] * return coll * except _get_in_exceptions: # <<<<<<<<<<<<<< * if no_default: * raise */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_v_7cytoolz_9dicttoolz__get_in_exceptions); if (__pyx_t_8) { __Pyx_AddTraceback("cytoolz.dicttoolz.get_in", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(0, 573, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_9); /* "cytoolz/dicttoolz.pyx":574 * return coll * except _get_in_exceptions: * if no_default: # <<<<<<<<<<<<<< * raise * return default */ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_no_default); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 574, __pyx_L5_except_error) if (unlikely(__pyx_t_10)) { /* "cytoolz/dicttoolz.pyx":575 * except _get_in_exceptions: * if no_default: * raise # <<<<<<<<<<<<<< * return default * */ __Pyx_GIVEREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_7); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_7, __pyx_t_9); __pyx_t_4 = 0; __pyx_t_7 = 0; __pyx_t_9 = 0; __PYX_ERR(0, 575, __pyx_L5_except_error) /* "cytoolz/dicttoolz.pyx":574 * return coll * except _get_in_exceptions: * if no_default: # <<<<<<<<<<<<<< * raise * return default */ } /* "cytoolz/dicttoolz.pyx":576 * if no_default: * raise * return default # <<<<<<<<<<<<<< * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "cytoolz/dicttoolz.pyx":569 * """ * cdef object item * try: # <<<<<<<<<<<<<< * for item in keys: * coll = coll[item] */ __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; } /* "cytoolz/dicttoolz.pyx":536 * * * cpdef object get_in(object keys, object coll, object default=None, object no_default=False): # <<<<<<<<<<<<<< * """ * Returns coll[i0][i1]...[iX] where [i0, i1, ..., iX]==keys. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("cytoolz.dicttoolz.get_in", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_item); __Pyx_XDECREF(__pyx_v_coll); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9dicttoolz_25get_in(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9dicttoolz_24get_in[] = "get_in(keys, coll, default=None, no_default=False)\n\n Returns coll[i0][i1]...[iX] where [i0, i1, ..., iX]==keys.\n\n If coll[i0][i1]...[iX] cannot be found, returns ``default``, unless\n ``no_default`` is specified, then it raises KeyError or IndexError.\n\n ``get_in`` is a generalization of ``operator.getitem`` for nested data\n structures such as dictionaries and lists.\n\n >>> transaction = {'name': 'Alice',\n ... 'purchase': {'items': ['Apple', 'Orange'],\n ... 'costs': [0.50, 1.25]},\n ... 'credit card': '5555-1234-1234-1234'}\n >>> get_in(['purchase', 'items', 0], transaction)\n 'Apple'\n >>> get_in(['name'], transaction)\n 'Alice'\n >>> get_in(['purchase', 'total'], transaction)\n >>> get_in(['purchase', 'items', 'apple'], transaction)\n >>> get_in(['purchase', 'items', 10], transaction)\n >>> get_in(['purchase', 'total'], transaction, 0)\n 0\n >>> get_in(['y'], {}, no_default=True)\n Traceback (most recent call last):\n ...\n KeyError: 'y'\n\n See Also:\n itertoolz.get\n operator.getitem\n "; static PyMethodDef __pyx_mdef_7cytoolz_9dicttoolz_25get_in = {"get_in", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9dicttoolz_25get_in, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9dicttoolz_24get_in}; static PyObject *__pyx_pw_7cytoolz_9dicttoolz_25get_in(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_keys = 0; PyObject *__pyx_v_coll = 0; PyObject *__pyx_v_default = 0; PyObject *__pyx_v_no_default = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get_in (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_keys,&__pyx_n_s_coll,&__pyx_n_s_default,&__pyx_n_s_no_default,0}; PyObject* values[4] = {0,0,0,0}; values[2] = ((PyObject *)Py_None); 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 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_keys)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_coll)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get_in", 0, 2, 4, 1); __PYX_ERR(0, 536, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default); if (value) { values[2] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_no_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, "get_in") < 0)) __PYX_ERR(0, 536, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; 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_keys = values[0]; __pyx_v_coll = values[1]; __pyx_v_default = values[2]; __pyx_v_no_default = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get_in", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 536, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.dicttoolz.get_in", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9dicttoolz_24get_in(__pyx_self, __pyx_v_keys, __pyx_v_coll, __pyx_v_default, __pyx_v_no_default); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9dicttoolz_24get_in(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_keys, PyObject *__pyx_v_coll, PyObject *__pyx_v_default, PyObject *__pyx_v_no_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_7cytoolz_9dicttoolz_get_in __pyx_t_2; __Pyx_RefNannySetupContext("get_in", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 2; __pyx_t_2.__pyx_default = __pyx_v_default; __pyx_t_2.no_default = __pyx_v_no_default; __pyx_t_1 = __pyx_f_7cytoolz_9dicttoolz_get_in(__pyx_v_keys, __pyx_v_coll, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.dicttoolz.get_in", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_7cytoolz_9dicttoolz__iter_mapping(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *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_7cytoolz_9dicttoolz__iter_mapping *)o); p->it = Py_None; Py_INCREF(Py_None); p->cur = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9dicttoolz_13_iter_mapping_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9dicttoolz__iter_mapping(PyObject *o) { struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *p = (struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->it); Py_CLEAR(p->cur); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9dicttoolz__iter_mapping(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *p = (struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *)o; if (p->it) { e = (*v)(p->it, a); if (e) return e; } if (p->cur) { e = (*v)(p->cur, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9dicttoolz__iter_mapping(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *p = (struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping *)o; tmp = ((PyObject*)p->it); p->it = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->cur); p->cur = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9dicttoolz_13_iter_mapping_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9dicttoolz_13_iter_mapping_5__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9dicttoolz__iter_mapping[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9dicttoolz_13_iter_mapping_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9dicttoolz_13_iter_mapping_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9dicttoolz_13_iter_mapping_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9dicttoolz_13_iter_mapping_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9dicttoolz_13_iter_mapping_8__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9dicttoolz__iter_mapping = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.dicttoolz._iter_mapping", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9dicttoolz__iter_mapping), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9dicttoolz__iter_mapping, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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*/ " Keep a handle on the current item to prevent memory clean up too early", /*tp_doc*/ __pyx_tp_traverse_7cytoolz_9dicttoolz__iter_mapping, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9dicttoolz__iter_mapping, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_7cytoolz_9dicttoolz_13_iter_mapping_3__iter__, /*tp_iter*/ __pyx_pw_7cytoolz_9dicttoolz_13_iter_mapping_5__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9dicttoolz__iter_mapping, /*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_7cytoolz_9dicttoolz__iter_mapping, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_dicttoolz(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_dicttoolz}, {0, NULL} }; #endif static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, "dicttoolz", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_0_got_an_unexpected_keyword_arg, __pyx_k_0_got_an_unexpected_keyword_arg, sizeof(__pyx_k_0_got_an_unexpected_keyword_arg), 0, 0, 1, 0}, {&__pyx_kp_u_Apply_function_to_items_of_dict, __pyx_k_Apply_function_to_items_of_dict, sizeof(__pyx_k_Apply_function_to_items_of_dict), 0, 1, 0, 0}, {&__pyx_kp_u_Apply_function_to_keys_of_dicti, __pyx_k_Apply_function_to_keys_of_dicti, sizeof(__pyx_k_Apply_function_to_keys_of_dicti), 0, 1, 0, 0}, {&__pyx_kp_u_Apply_function_to_values_of_dic, __pyx_k_Apply_function_to_values_of_dic, sizeof(__pyx_k_Apply_function_to_values_of_dic), 0, 1, 0, 0}, {&__pyx_kp_u_Filter_items_in_dictionary_by_i, __pyx_k_Filter_items_in_dictionary_by_i, sizeof(__pyx_k_Filter_items_in_dictionary_by_i), 0, 1, 0, 0}, {&__pyx_kp_u_Filter_items_in_dictionary_by_k, __pyx_k_Filter_items_in_dictionary_by_k, sizeof(__pyx_k_Filter_items_in_dictionary_by_k), 0, 1, 0, 0}, {&__pyx_kp_u_Filter_items_in_dictionary_by_v, __pyx_k_Filter_items_in_dictionary_by_v, sizeof(__pyx_k_Filter_items_in_dictionary_by_v), 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_Merge_a_collection_of_dictionar, __pyx_k_Merge_a_collection_of_dictionar, sizeof(__pyx_k_Merge_a_collection_of_dictionar), 0, 1, 0, 0}, {&__pyx_kp_u_Merge_dictionaries_and_apply_fu, __pyx_k_Merge_dictionaries_and_apply_fu, sizeof(__pyx_k_Merge_dictionaries_and_apply_fu), 0, 1, 0, 0}, {&__pyx_kp_u_Return_a_new_dict_with_new_key, __pyx_k_Return_a_new_dict_with_new_key, sizeof(__pyx_k_Return_a_new_dict_with_new_key), 0, 1, 0, 0}, {&__pyx_kp_u_Return_a_new_dict_with_new_pote, __pyx_k_Return_a_new_dict_with_new_pote, sizeof(__pyx_k_Return_a_new_dict_with_new_pote), 0, 1, 0, 0}, {&__pyx_kp_u_Return_a_new_dict_with_the_give, __pyx_k_Return_a_new_dict_with_the_give, sizeof(__pyx_k_Return_a_new_dict_with_the_give), 0, 1, 0, 0}, {&__pyx_kp_u_Returns_coll_i0_i1_iX_where_i0, __pyx_k_Returns_coll_i0_i1_iX_where_i0, sizeof(__pyx_k_Returns_coll_i0_i1_iX_where_i0), 0, 1, 0, 0}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_kp_u_Update_value_in_a_potentially_n, __pyx_k_Update_value_in_a_potentially_n, sizeof(__pyx_k_Update_value_in_a_potentially_n), 0, 1, 0, 0}, {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, {&__pyx_n_s_assoc, __pyx_k_assoc, sizeof(__pyx_k_assoc), 0, 0, 1, 1}, {&__pyx_n_s_assoc_in, __pyx_k_assoc_in, sizeof(__pyx_k_assoc_in), 0, 0, 1, 1}, {&__pyx_kp_u_assoc_in_line_389, __pyx_k_assoc_in_line_389, sizeof(__pyx_k_assoc_in_line_389), 0, 1, 0, 0}, {&__pyx_kp_u_assoc_line_368, __pyx_k_assoc_line_368, sizeof(__pyx_k_assoc_line_368), 0, 1, 0, 0}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_coll, __pyx_k_coll, sizeof(__pyx_k_coll), 0, 0, 1, 1}, {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, {&__pyx_n_s_cytoolz_dicttoolz, __pyx_k_cytoolz_dicttoolz, sizeof(__pyx_k_cytoolz_dicttoolz), 0, 0, 1, 1}, {&__pyx_kp_s_cytoolz_dicttoolz_pyx, __pyx_k_cytoolz_dicttoolz_pyx, sizeof(__pyx_k_cytoolz_dicttoolz_pyx), 0, 0, 1, 0}, {&__pyx_n_s_d, __pyx_k_d, sizeof(__pyx_k_d), 0, 0, 1, 1}, {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, {&__pyx_n_s_dicts, __pyx_k_dicts, sizeof(__pyx_k_dicts), 0, 0, 1, 1}, {&__pyx_n_s_difference_update, __pyx_k_difference_update, sizeof(__pyx_k_difference_update), 0, 0, 1, 1}, {&__pyx_n_s_dissoc, __pyx_k_dissoc, sizeof(__pyx_k_dissoc), 0, 0, 1, 1}, {&__pyx_kp_u_dissoc_line_448, __pyx_k_dissoc_line_448, sizeof(__pyx_k_dissoc_line_448), 0, 1, 0, 0}, {&__pyx_n_s_factory, __pyx_k_factory, sizeof(__pyx_k_factory), 0, 0, 1, 1}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, {&__pyx_n_s_get_in, __pyx_k_get_in, sizeof(__pyx_k_get_in), 0, 0, 1, 1}, {&__pyx_kp_u_get_in_line_536, __pyx_k_get_in_line_536, sizeof(__pyx_k_get_in_line_536), 0, 1, 0, 0}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_it, __pyx_k_it, sizeof(__pyx_k_it), 0, 0, 1, 1}, {&__pyx_n_s_itemfilter, __pyx_k_itemfilter, sizeof(__pyx_k_itemfilter), 0, 0, 1, 1}, {&__pyx_kp_u_itemfilter_line_331, __pyx_k_itemfilter_line_331, sizeof(__pyx_k_itemfilter_line_331), 0, 1, 0, 0}, {&__pyx_n_s_itemmap, __pyx_k_itemmap, sizeof(__pyx_k_itemmap), 0, 0, 1, 1}, {&__pyx_kp_u_itemmap_line_237, __pyx_k_itemmap_line_237, sizeof(__pyx_k_itemmap_line_237), 0, 1, 0, 0}, {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, {&__pyx_n_s_iter_mapping, __pyx_k_iter_mapping, sizeof(__pyx_k_iter_mapping), 0, 0, 1, 1}, {&__pyx_n_s_iter_mapping___reduce_cython, __pyx_k_iter_mapping___reduce_cython, sizeof(__pyx_k_iter_mapping___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_iter_mapping___setstate_cython, __pyx_k_iter_mapping___setstate_cython, sizeof(__pyx_k_iter_mapping___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_n_s_keyfilter, __pyx_k_keyfilter, sizeof(__pyx_k_keyfilter), 0, 0, 1, 1}, {&__pyx_kp_u_keyfilter_line_299, __pyx_k_keyfilter_line_299, sizeof(__pyx_k_keyfilter_line_299), 0, 1, 0, 0}, {&__pyx_n_s_keymap, __pyx_k_keymap, sizeof(__pyx_k_keymap), 0, 0, 1, 1}, {&__pyx_kp_u_keymap_line_208, __pyx_k_keymap_line_208, sizeof(__pyx_k_keymap_line_208), 0, 1, 0, 0}, {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1}, {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_merge, __pyx_k_merge, sizeof(__pyx_k_merge), 0, 0, 1, 1}, {&__pyx_kp_u_merge_line_100, __pyx_k_merge_line_100, sizeof(__pyx_k_merge_line_100), 0, 1, 0, 0}, {&__pyx_n_s_merge_with, __pyx_k_merge_with, sizeof(__pyx_k_merge_with), 0, 0, 1, 1}, {&__pyx_kp_u_merge_with_line_157, __pyx_k_merge_with_line_157, sizeof(__pyx_k_merge_with_line_157), 0, 1, 0, 0}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_no_default, __pyx_k_no_default, sizeof(__pyx_k_no_default), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1}, {&__pyx_n_s_popitem, __pyx_k_popitem, sizeof(__pyx_k_popitem), 0, 0, 1, 1}, {&__pyx_n_s_predicate, __pyx_k_predicate, sizeof(__pyx_k_predicate), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_update_in, __pyx_k_update_in, sizeof(__pyx_k_update_in), 0, 0, 1, 1}, {&__pyx_kp_u_update_in_line_465, __pyx_k_update_in_line_465, sizeof(__pyx_k_update_in_line_465), 0, 1, 0, 0}, {&__pyx_n_s_valfilter, __pyx_k_valfilter, sizeof(__pyx_k_valfilter), 0, 0, 1, 1}, {&__pyx_kp_u_valfilter_line_267, __pyx_k_valfilter_line_267, sizeof(__pyx_k_valfilter_line_267), 0, 1, 0, 0}, {&__pyx_n_s_valmap, __pyx_k_valmap, sizeof(__pyx_k_valmap), 0, 0, 1, 1}, {&__pyx_kp_u_valmap_line_179, __pyx_k_valmap_line_179, sizeof(__pyx_k_valmap_line_179), 0, 1, 0, 0}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 533, __pyx_L1_error) __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 533, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 533, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "cytoolz/dicttoolz.pyx":404 * cdef object prevkey, key * cdef object rv, inner, dtemp * prevkey, keys = keys[0], keys[1:] # <<<<<<<<<<<<<< * rv = factory() * if PyDict_CheckExact(rv): */ __pyx_slice__13 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__13); __Pyx_GIVEREF(__pyx_slice__13); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__18 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(1, 3, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":100 * * * def merge(*dicts, **kwargs): # <<<<<<<<<<<<<< * """ * Merge a collection of dictionaries */ __pyx_tuple__20 = PyTuple_Pack(3, __pyx_n_s_dicts, __pyx_n_s_kwargs, __pyx_n_s_factory); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_dicttoolz_pyx, __pyx_n_s_merge, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 100, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":157 * * * def merge_with(func, *dicts, **kwargs): # <<<<<<<<<<<<<< * """ * Merge dictionaries and apply function to combined values */ __pyx_tuple__22 = PyTuple_Pack(4, __pyx_n_s_func, __pyx_n_s_dicts, __pyx_n_s_kwargs, __pyx_n_s_factory); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_dicttoolz_pyx, __pyx_n_s_merge_with, 157, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 157, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":179 * * * cpdef object valmap(object func, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Apply function to values of dictionary */ __pyx_tuple__24 = PyTuple_Pack(3, __pyx_n_s_func, __pyx_n_s_d, __pyx_n_s_factory); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_dicttoolz_pyx, __pyx_n_s_valmap, 179, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 179, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":208 * * * cpdef object keymap(object func, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Apply function to keys of dictionary */ __pyx_tuple__26 = PyTuple_Pack(3, __pyx_n_s_func, __pyx_n_s_d, __pyx_n_s_factory); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_dicttoolz_pyx, __pyx_n_s_keymap, 208, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 208, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":237 * * * cpdef object itemmap(object func, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Apply function to items of dictionary */ __pyx_tuple__28 = PyTuple_Pack(3, __pyx_n_s_func, __pyx_n_s_d, __pyx_n_s_factory); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_dicttoolz_pyx, __pyx_n_s_itemmap, 237, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 237, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":267 * * * cpdef object valfilter(object predicate, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Filter items in dictionary by value */ __pyx_tuple__30 = PyTuple_Pack(3, __pyx_n_s_predicate, __pyx_n_s_d, __pyx_n_s_factory); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_dicttoolz_pyx, __pyx_n_s_valfilter, 267, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 267, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":299 * * * cpdef object keyfilter(object predicate, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Filter items in dictionary by key */ __pyx_tuple__32 = PyTuple_Pack(3, __pyx_n_s_predicate, __pyx_n_s_d, __pyx_n_s_factory); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_dicttoolz_pyx, __pyx_n_s_keyfilter, 299, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 299, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":331 * * * cpdef object itemfilter(object predicate, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Filter items in dictionary by item */ __pyx_tuple__34 = PyTuple_Pack(3, __pyx_n_s_predicate, __pyx_n_s_d, __pyx_n_s_factory); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_dicttoolz_pyx, __pyx_n_s_itemfilter, 331, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 331, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":368 * * * cpdef object assoc(object d, object key, object value, object factory=dict): # <<<<<<<<<<<<<< * """ * Return a new dict with new key value pair */ __pyx_tuple__36 = PyTuple_Pack(4, __pyx_n_s_d, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_factory); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_dicttoolz_pyx, __pyx_n_s_assoc, 368, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 368, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":389 * * * cpdef object assoc_in(object d, object keys, object value, object factory=dict): # <<<<<<<<<<<<<< * """ * Return a new dict with new, potentially nested, key value pair */ __pyx_tuple__38 = PyTuple_Pack(4, __pyx_n_s_d, __pyx_n_s_keys, __pyx_n_s_value, __pyx_n_s_factory); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_dicttoolz_pyx, __pyx_n_s_assoc_in, 389, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 389, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":448 * * * def dissoc(d, *keys, **kwargs): # <<<<<<<<<<<<<< * """ * Return a new dict with the given key(s) removed. */ __pyx_tuple__40 = PyTuple_Pack(3, __pyx_n_s_d, __pyx_n_s_keys, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_dicttoolz_pyx, __pyx_n_s_dissoc, 448, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 448, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":465 * * * cpdef object update_in(object d, object keys, object func, object default=None, object factory=dict): # <<<<<<<<<<<<<< * """ * Update value in a (potentially) nested dictionary */ __pyx_tuple__42 = PyTuple_Pack(5, __pyx_n_s_d, __pyx_n_s_keys, __pyx_n_s_func, __pyx_n_s_default, __pyx_n_s_factory); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_dicttoolz_pyx, __pyx_n_s_update_in, 465, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 465, __pyx_L1_error) /* "cytoolz/dicttoolz.pyx":533 * * * cdef tuple _get_in_exceptions = (KeyError, IndexError, TypeError) # <<<<<<<<<<<<<< * * */ __pyx_tuple__44 = PyTuple_Pack(3, __pyx_builtin_KeyError, __pyx_builtin_IndexError, __pyx_builtin_TypeError); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__44); __Pyx_GIVEREF(__pyx_tuple__44); /* "cytoolz/dicttoolz.pyx":536 * * * cpdef object get_in(object keys, object coll, object default=None, object no_default=False): # <<<<<<<<<<<<<< * """ * Returns coll[i0][i1]...[iX] where [i0, i1, ..., iX]==keys. */ __pyx_tuple__45 = PyTuple_Pack(4, __pyx_n_s_keys, __pyx_n_s_coll, __pyx_n_s_default, __pyx_n_s_no_default); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_dicttoolz_pyx, __pyx_n_s_get_in, 536, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { __pyx_umethod_PySet_Type_difference_update.type = (PyObject*)&PySet_Type; if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __pyx_v_7cytoolz_9dicttoolz__get_in_exceptions = ((PyObject*)Py_None); Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ if (__Pyx_ExportFunction("get_map_iter", (void (*)(void))__pyx_f_7cytoolz_9dicttoolz_get_map_iter, "__pyx_t_7cytoolz_9dicttoolz_f_map_next (PyObject *, PyObject **)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("PyMapping_Next", (void (*)(void))__pyx_f_7cytoolz_9dicttoolz_PyMapping_Next, "int (PyObject *, Py_ssize_t *, PyObject **, PyObject **)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("c_merge", (void (*)(void))__pyx_f_7cytoolz_9dicttoolz_c_merge, "PyObject *(PyObject *, struct __pyx_opt_args_7cytoolz_9dicttoolz_c_merge *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("c_merge_with", (void (*)(void))__pyx_f_7cytoolz_9dicttoolz_c_merge_with, "PyObject *(PyObject *, PyObject *, struct __pyx_opt_args_7cytoolz_9dicttoolz_c_merge_with *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("valmap", (void (*)(void))__pyx_f_7cytoolz_9dicttoolz_valmap, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_valmap *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("keymap", (void (*)(void))__pyx_f_7cytoolz_9dicttoolz_keymap, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_keymap *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("itemmap", (void (*)(void))__pyx_f_7cytoolz_9dicttoolz_itemmap, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_itemmap *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("valfilter", (void (*)(void))__pyx_f_7cytoolz_9dicttoolz_valfilter, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_valfilter *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("keyfilter", (void (*)(void))__pyx_f_7cytoolz_9dicttoolz_keyfilter, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_keyfilter *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("itemfilter", (void (*)(void))__pyx_f_7cytoolz_9dicttoolz_itemfilter, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_itemfilter *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("assoc", (void (*)(void))__pyx_f_7cytoolz_9dicttoolz_assoc, "PyObject *(PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_assoc *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("assoc_in", (void (*)(void))__pyx_f_7cytoolz_9dicttoolz_assoc_in, "PyObject *(PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_assoc_in *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("c_dissoc", (void (*)(void))__pyx_f_7cytoolz_9dicttoolz_c_dissoc, "PyObject *(PyObject *, PyObject *, struct __pyx_opt_args_7cytoolz_9dicttoolz_c_dissoc *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("update_in", (void (*)(void))__pyx_f_7cytoolz_9dicttoolz_update_in, "PyObject *(PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_update_in *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("get_in", (void (*)(void))__pyx_f_7cytoolz_9dicttoolz_get_in, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9dicttoolz_get_in *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_7cytoolz_9dicttoolz__iter_mapping) < 0) __PYX_ERR(0, 19, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9dicttoolz__iter_mapping.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9dicttoolz__iter_mapping.tp_dictoffset && __pyx_type_7cytoolz_9dicttoolz__iter_mapping.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9dicttoolz__iter_mapping.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_iter_mapping, (PyObject *)&__pyx_type_7cytoolz_9dicttoolz__iter_mapping) < 0) __PYX_ERR(0, 19, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9dicttoolz__iter_mapping) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __pyx_ptype_7cytoolz_9dicttoolz__iter_mapping = &__pyx_type_7cytoolz_9dicttoolz__iter_mapping; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), #else sizeof(PyHeapTypeObject), #endif __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION < 3 #ifdef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC void #else #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #endif #else #ifdef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyObject * #else #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initdicttoolz(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initdicttoolz(void) #else __Pyx_PyMODINIT_FUNC PyInit_dicttoolz(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_dicttoolz(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { result = PyDict_SetItemString(moddict, to_name, value); } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_dicttoolz(PyObject *__pyx_pyinit_module) #endif #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'dicttoolz' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif #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("__Pyx_PyMODINIT_FUNC PyInit_dicttoolz(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __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 CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("dicttoolz", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __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_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_cytoolz__dicttoolz) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "cytoolz.dicttoolz")) { if (unlikely(PyDict_SetItemString(modules, "cytoolz.dicttoolz", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error; /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error; /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "cytoolz/dicttoolz.pyx":11 * from cytoolz.cpython cimport PyDict_Next_Compat, PtrIter_Next * * from copy import copy # <<<<<<<<<<<<<< * * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_copy); __Pyx_GIVEREF(__pyx_n_s_copy); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_copy); __pyx_t_2 = __Pyx_Import(__pyx_n_s_copy, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __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_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":14 * * * __all__ = ['merge', 'merge_with', 'valmap', 'keymap', 'itemmap', 'valfilter', # <<<<<<<<<<<<<< * 'keyfilter', 'itemfilter', 'assoc', 'dissoc', 'assoc_in', 'get_in', * 'update_in'] */ __pyx_t_2 = PyList_New(13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_merge); __Pyx_GIVEREF(__pyx_n_s_merge); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_merge); __Pyx_INCREF(__pyx_n_s_merge_with); __Pyx_GIVEREF(__pyx_n_s_merge_with); PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_merge_with); __Pyx_INCREF(__pyx_n_s_valmap); __Pyx_GIVEREF(__pyx_n_s_valmap); PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_valmap); __Pyx_INCREF(__pyx_n_s_keymap); __Pyx_GIVEREF(__pyx_n_s_keymap); PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_keymap); __Pyx_INCREF(__pyx_n_s_itemmap); __Pyx_GIVEREF(__pyx_n_s_itemmap); PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_itemmap); __Pyx_INCREF(__pyx_n_s_valfilter); __Pyx_GIVEREF(__pyx_n_s_valfilter); PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_s_valfilter); __Pyx_INCREF(__pyx_n_s_keyfilter); __Pyx_GIVEREF(__pyx_n_s_keyfilter); PyList_SET_ITEM(__pyx_t_2, 6, __pyx_n_s_keyfilter); __Pyx_INCREF(__pyx_n_s_itemfilter); __Pyx_GIVEREF(__pyx_n_s_itemfilter); PyList_SET_ITEM(__pyx_t_2, 7, __pyx_n_s_itemfilter); __Pyx_INCREF(__pyx_n_s_assoc); __Pyx_GIVEREF(__pyx_n_s_assoc); PyList_SET_ITEM(__pyx_t_2, 8, __pyx_n_s_assoc); __Pyx_INCREF(__pyx_n_s_dissoc); __Pyx_GIVEREF(__pyx_n_s_dissoc); PyList_SET_ITEM(__pyx_t_2, 9, __pyx_n_s_dissoc); __Pyx_INCREF(__pyx_n_s_assoc_in); __Pyx_GIVEREF(__pyx_n_s_assoc_in); PyList_SET_ITEM(__pyx_t_2, 10, __pyx_n_s_assoc_in); __Pyx_INCREF(__pyx_n_s_get_in); __Pyx_GIVEREF(__pyx_n_s_get_in); PyList_SET_ITEM(__pyx_t_2, 11, __pyx_n_s_get_in); __Pyx_INCREF(__pyx_n_s_update_in); __Pyx_GIVEREF(__pyx_n_s_update_in); PyList_SET_ITEM(__pyx_t_2, 12, __pyx_n_s_update_in); if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9dicttoolz_13_iter_mapping_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_iter_mapping___reduce_cython, NULL, __pyx_n_s_cytoolz_dicttoolz, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9dicttoolz_13_iter_mapping_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_iter_mapping___setstate_cython, NULL, __pyx_n_s_cytoolz_dicttoolz, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":88 * * * cdef object c_merge(object dicts, object factory=dict): # <<<<<<<<<<<<<< * cdef object rv * rv = factory() */ __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __pyx_k__3 = ((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((&PyDict_Type)); /* "cytoolz/dicttoolz.pyx":100 * * * def merge(*dicts, **kwargs): # <<<<<<<<<<<<<< * """ * Merge a collection of dictionaries */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9dicttoolz_1merge, 0, __pyx_n_s_merge, NULL, __pyx_n_s_cytoolz_dicttoolz, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_merge, __pyx_t_2) < 0) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":121 * * * cdef object c_merge_with(object func, object dicts, object factory=dict): # <<<<<<<<<<<<<< * cdef: * dict result */ __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __pyx_k__4 = ((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((&PyDict_Type)); /* "cytoolz/dicttoolz.pyx":157 * * * def merge_with(func, *dicts, **kwargs): # <<<<<<<<<<<<<< * """ * Merge dictionaries and apply function to combined values */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9dicttoolz_3merge_with, 0, __pyx_n_s_merge_with, NULL, __pyx_n_s_cytoolz_dicttoolz, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_merge_with, __pyx_t_2) < 0) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":179 * * * cpdef object valmap(object func, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Apply function to values of dictionary */ __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __pyx_k__5 = ((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((&PyDict_Type)); __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __pyx_k__5 = ((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((&PyDict_Type)); __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9dicttoolz_5valmap, 0, __pyx_n_s_valmap, NULL, __pyx_n_s_cytoolz_dicttoolz, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_valmap, __pyx_t_2) < 0) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":208 * * * cpdef object keymap(object func, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Apply function to keys of dictionary */ __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __pyx_k__6 = ((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((&PyDict_Type)); __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __pyx_k__6 = ((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((&PyDict_Type)); __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9dicttoolz_7keymap, 0, __pyx_n_s_keymap, NULL, __pyx_n_s_cytoolz_dicttoolz, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_keymap, __pyx_t_2) < 0) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":237 * * * cpdef object itemmap(object func, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Apply function to items of dictionary */ __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __pyx_k__7 = ((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((&PyDict_Type)); __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __pyx_k__7 = ((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((&PyDict_Type)); __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9dicttoolz_9itemmap, 0, __pyx_n_s_itemmap, NULL, __pyx_n_s_cytoolz_dicttoolz, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_itemmap, __pyx_t_2) < 0) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":267 * * * cpdef object valfilter(object predicate, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Filter items in dictionary by value */ __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __pyx_k__8 = ((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((&PyDict_Type)); __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __pyx_k__8 = ((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((&PyDict_Type)); __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9dicttoolz_11valfilter, 0, __pyx_n_s_valfilter, NULL, __pyx_n_s_cytoolz_dicttoolz, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_valfilter, __pyx_t_2) < 0) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":299 * * * cpdef object keyfilter(object predicate, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Filter items in dictionary by key */ __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __pyx_k__9 = ((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((&PyDict_Type)); __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __pyx_k__9 = ((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((&PyDict_Type)); __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9dicttoolz_13keyfilter, 0, __pyx_n_s_keyfilter, NULL, __pyx_n_s_cytoolz_dicttoolz, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_keyfilter, __pyx_t_2) < 0) __PYX_ERR(0, 299, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":331 * * * cpdef object itemfilter(object predicate, object d, object factory=dict): # <<<<<<<<<<<<<< * """ * Filter items in dictionary by item */ __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __pyx_k__10 = ((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((&PyDict_Type)); __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __pyx_k__10 = ((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((&PyDict_Type)); __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9dicttoolz_15itemfilter, 0, __pyx_n_s_itemfilter, NULL, __pyx_n_s_cytoolz_dicttoolz, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_itemfilter, __pyx_t_2) < 0) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":368 * * * cpdef object assoc(object d, object key, object value, object factory=dict): # <<<<<<<<<<<<<< * """ * Return a new dict with new key value pair */ __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __pyx_k__11 = ((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((&PyDict_Type)); __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __pyx_k__11 = ((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((&PyDict_Type)); __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9dicttoolz_17assoc, 0, __pyx_n_s_assoc, NULL, __pyx_n_s_cytoolz_dicttoolz, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_assoc, __pyx_t_2) < 0) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":389 * * * cpdef object assoc_in(object d, object keys, object value, object factory=dict): # <<<<<<<<<<<<<< * """ * Return a new dict with new, potentially nested, key value pair */ __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __pyx_k__12 = ((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((&PyDict_Type)); __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __pyx_k__12 = ((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((&PyDict_Type)); __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9dicttoolz_19assoc_in, 0, __pyx_n_s_assoc_in, NULL, __pyx_n_s_cytoolz_dicttoolz, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_assoc_in, __pyx_t_2) < 0) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":431 * * * cdef object c_dissoc(object d, object keys, object factory=dict): # <<<<<<<<<<<<<< * # implementation copied from toolz. Not benchmarked. * cdef object rv */ __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __pyx_k__14 = ((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((&PyDict_Type)); /* "cytoolz/dicttoolz.pyx":448 * * * def dissoc(d, *keys, **kwargs): # <<<<<<<<<<<<<< * """ * Return a new dict with the given key(s) removed. */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9dicttoolz_21dissoc, 0, __pyx_n_s_dissoc, NULL, __pyx_n_s_cytoolz_dicttoolz, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_dissoc, __pyx_t_2) < 0) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":465 * * * cpdef object update_in(object d, object keys, object func, object default=None, object factory=dict): # <<<<<<<<<<<<<< * """ * Update value in a (potentially) nested dictionary */ __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __pyx_k__15 = ((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((&PyDict_Type)); __Pyx_INCREF(((PyObject *)(&PyDict_Type))); __pyx_k__15 = ((PyObject *)(&PyDict_Type)); __Pyx_GIVEREF((&PyDict_Type)); __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9dicttoolz_23update_in, 0, __pyx_n_s_update_in, NULL, __pyx_n_s_cytoolz_dicttoolz, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_update_in, __pyx_t_2) < 0) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":533 * * * cdef tuple _get_in_exceptions = (KeyError, IndexError, TypeError) # <<<<<<<<<<<<<< * * */ __Pyx_INCREF(__pyx_tuple__44); __Pyx_XGOTREF(__pyx_v_7cytoolz_9dicttoolz__get_in_exceptions); __Pyx_DECREF_SET(__pyx_v_7cytoolz_9dicttoolz__get_in_exceptions, __pyx_tuple__44); __Pyx_GIVEREF(__pyx_tuple__44); /* "cytoolz/dicttoolz.pyx":536 * * * cpdef object get_in(object keys, object coll, object default=None, object no_default=False): # <<<<<<<<<<<<<< * """ * Returns coll[i0][i1]...[iX] where [i0, i1, ..., iX]==keys. */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9dicttoolz_25get_in, 0, __pyx_n_s_get_in, NULL, __pyx_n_s_cytoolz_dicttoolz, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_in, __pyx_t_2) < 0) __PYX_ERR(0, 536, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/dicttoolz.pyx":1 * from cpython.dict cimport (PyDict_Check, PyDict_CheckExact, PyDict_GetItem, # <<<<<<<<<<<<<< * PyDict_Merge, PyDict_New, PyDict_Next, * PyDict_SetItem, PyDict_Update, PyDict_DelItem) */ __pyx_t_2 = __Pyx_PyDict_NewPresized(13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_merge_line_100, __pyx_kp_u_Merge_a_collection_of_dictionar) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_merge_with_line_157, __pyx_kp_u_Merge_dictionaries_and_apply_fu) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_valmap_line_179, __pyx_kp_u_Apply_function_to_values_of_dic) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_keymap_line_208, __pyx_kp_u_Apply_function_to_keys_of_dicti) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_itemmap_line_237, __pyx_kp_u_Apply_function_to_items_of_dict) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_valfilter_line_267, __pyx_kp_u_Filter_items_in_dictionary_by_v) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_keyfilter_line_299, __pyx_kp_u_Filter_items_in_dictionary_by_k) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_itemfilter_line_331, __pyx_kp_u_Filter_items_in_dictionary_by_i) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_assoc_line_368, __pyx_kp_u_Return_a_new_dict_with_new_key) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_assoc_in_line_389, __pyx_kp_u_Return_a_new_dict_with_new_pote) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_dissoc_line_448, __pyx_kp_u_Return_a_new_dict_with_the_give) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_update_in_line_465, __pyx_kp_u_Update_value_in_a_potentially_n) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_get_in_line_536, __pyx_kp_u_Returns_coll_i0_i1_iX_where_i0) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init cytoolz.dicttoolz", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_CLEAR(__pyx_m); } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init cytoolz.dicttoolz"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS 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); } #endif /* GetBuiltinName */ 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; } /* RaiseDoubleKeywords */ 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 } /* ParseKeywords */ 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; } /* RaiseArgTupleInvalid */ 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); } /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; 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); } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; } #endif /* IterNext */ static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_Occurred(); if (unlikely(exc_type)) { if (!defval || unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(defval); return defval; } if (defval) { Py_INCREF(defval); return defval; } __Pyx_PyErr_SetNone(PyExc_StopIteration); return NULL; } static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) { PyErr_Format(PyExc_TypeError, "%.200s object is not an iterator", Py_TYPE(iterator)->tp_name); } static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) { PyObject* next; iternextfunc iternext = Py_TYPE(iterator)->tp_iternext; if (likely(iternext)) { #if CYTHON_USE_TYPE_SLOTS next = iternext(iterator); if (likely(next)) return next; #if PY_VERSION_HEX >= 0x02070000 if (unlikely(iternext == &_PyObject_NextNotImplemented)) return NULL; #endif #else next = PyIter_Next(iterator); if (likely(next)) return next; #endif } else if (CYTHON_USE_TYPE_SLOTS || unlikely(!PyIter_Check(iterator))) { __Pyx_PyIter_Next_ErrorNoIterator(iterator); return NULL; } #if !CYTHON_USE_TYPE_SLOTS else { next = PyIter_Next(iterator); if (likely(next)) return next; } #endif return __Pyx_PyIter_Next2Default(defval); } /* PyObjectCall */ #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 (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare 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 (PyType_Check(type)) { #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; 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; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else 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) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } 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 (cause) { 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) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* GetItemInt */ static 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, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_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, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_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, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(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(__Pyx_is_valid_index(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)) return NULL; PyErr_Clear(); } } 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)); } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #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); } /* HasAttr */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!__Pyx_PyBaseString_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } r = __Pyx_GetAttr(o, n); if (unlikely(!r)) { PyErr_Clear(); return 0; } else { Py_DECREF(r); return 1; } } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { return NULL; } if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallNoArg */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) #else if (likely(PyCFunction_Check(func))) #endif { if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { PyCFunctionObject *func = (PyCFunctionObject*)func_obj; PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyObject *self = PyCFunction_GET_SELF(func); int flags = PyCFunction_GET_FLAGS(func); assert(PyCFunction_Check(func)); assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); assert(nargs >= 0); assert(nargs == 0 || args != NULL); /* _PyCFunction_FastCallDict() must not be called with an exception set, because it may clear it (directly or indirectly) and so the caller loses its exception */ assert(!PyErr_Occurred()); if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); } else { return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); } } #endif /* PyObjectCallOneArg */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif if (likely(PyCFunction_Check(func))) { if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { return __Pyx_PyCFunction_FastCall(func, &arg, 1); #endif } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif /* PyObjectCall2Args */ static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args, *result = NULL; #if CYTHON_FAST_PYCALL if (PyFunction_Check(function)) { PyObject *args[2] = {arg1, arg2}; return __Pyx_PyFunction_FastCall(function, args, 2); } #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(function)) { PyObject *args[2] = {arg1, arg2}; return __Pyx_PyCFunction_FastCall(function, args, 2); } #endif args = PyTuple_New(2); if (unlikely(!args)) goto done; Py_INCREF(arg1); PyTuple_SET_ITEM(args, 0, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 1, arg2); Py_INCREF(function); result = __Pyx_PyObject_Call(function, args, NULL); Py_DECREF(args); Py_DECREF(function); done: return result; } /* KeywordStringCheck */ static 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_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; } /* RaiseTooManyValuesToUnpack */ 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); } /* RaiseNeedMoreValuesToUnpack */ 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"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(__Pyx_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 } /* UnpackItemEndCheck */ 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; } /* SliceObject */ 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_USE_TYPE_SLOTS 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)) goto bad; PyErr_Clear(); } } 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_USE_TYPE_SLOTS 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; } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { PyObject *runerr; Py_ssize_t key_value; PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; if (unlikely(!(m && m->sq_item))) { PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); return NULL; } key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; if (likely(m && m->mp_subscript)) { return m->mp_subscript(obj, key); } return __Pyx_PyObject_GetIndex(obj, key); } #endif /* UnpackUnboundCMethod */ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { PyObject *method; method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); if (unlikely(!method)) return -1; target->method = method; #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject*) method; target->func = descr->d_method->ml_meth; target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); } #endif return 0; } /* CallUnboundCMethod1 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { if (likely(cfunc->func)) { int flag = cfunc->flag; if (flag == METH_O) { return (*(cfunc->func))(self, arg); } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) { if (PY_VERSION_HEX >= 0x030700A0) { return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); } else { return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); } } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) { return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); } } return __Pyx__CallUnboundCMethod1(cfunc, self, arg); } #endif static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ PyObject *args, *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { args = PyTuple_New(1); if (unlikely(!args)) goto bad; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); } else { args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); result = __Pyx_PyObject_Call(cfunc->method, args, NULL); } #else args = PyTuple_Pack(2, self, arg); if (unlikely(!args)) goto bad; result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif bad: Py_XDECREF(args); return result; } /* set_iter */ static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set, Py_ssize_t* p_orig_length, int* p_source_is_set) { #if CYTHON_COMPILING_IN_CPYTHON is_set = is_set || likely(PySet_CheckExact(iterable) || PyFrozenSet_CheckExact(iterable)); *p_source_is_set = is_set; if (likely(is_set)) { *p_orig_length = PySet_Size(iterable); Py_INCREF(iterable); return iterable; } #else (void)is_set; *p_source_is_set = 0; #endif *p_orig_length = 0; return PyObject_GetIter(iterable); } static CYTHON_INLINE int __Pyx_set_iter_next( PyObject* iter_obj, Py_ssize_t orig_length, Py_ssize_t* ppos, PyObject **value, int source_is_set) { if (!CYTHON_COMPILING_IN_CPYTHON || unlikely(!source_is_set)) { *value = PyIter_Next(iter_obj); if (unlikely(!*value)) { return __Pyx_IterFinish(); } (void)orig_length; (void)ppos; return 1; } #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(PySet_GET_SIZE(iter_obj) != orig_length)) { PyErr_SetString( PyExc_RuntimeError, "set changed size during iteration"); return -1; } { Py_hash_t hash; int ret = _PySet_NextEntry(iter_obj, ppos, value, &hash); assert (ret != -1); if (likely(ret)) { Py_INCREF(*value); return 1; } } #endif return 0; } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; #endif Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else 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; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; icurexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; if (unlikely(PyTuple_Check(err))) return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type, *local_value, *local_tb; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; 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_FAST_THREAD_STATE 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_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; } #else 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; #endif 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; } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'%.50s' object has no attribute '%U'", tp->tp_name, attr_name); #else "'%.50s' object has no attribute '%.400s'", tp->tp_name, PyString_AS_STRING(attr_name)); #endif return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; #if CYTHON_USE_PYTYPE_LOOKUP if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD; #else if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD; #endif #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD; ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD; setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD; ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD; } PyType_Modified((PyTypeObject*)type_obj); } } goto GOOD; BAD: if (!PyErr_Occurred()) PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); ret = -1; GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif result = PyObject_GetAttrString(module, class_name); 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 ((size_t)basicsize < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* Import */ 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_MAJOR_VERSION < 3 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_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } /* ImportFrom */ 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; } /* FetchCommonType */ 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; } /* CythonFunction */ #include 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, CYTHON_UNUSED void *context) { PyObject *tmp = op->func_doc; if (value == NULL) { value = Py_None; } Py_INCREF(value); op->func_doc = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 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); #else op->defaults_tuple = PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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} }; static PyMemberDef __pyx_CyFunction_members[] = { {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, 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[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif 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; __Pyx_CyFunction_weakreflist(op) = 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]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); PyObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(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 __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); } if (obj == Py_None) obj = NULL; return __Pyx_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 } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; Py_ssize_t size; switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 0)) return (*meth)(self, NULL); PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d 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 (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d 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; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; argc = PyTuple_GET_SIZE(args); new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, 0, 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_CyFunction_descr_get, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 0, #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, #endif }; static int __pyx_CyFunction_init(void) { __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); if (unlikely(__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 = PyObject_Malloc(size); if (unlikely(!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); } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ 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 - start) / 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); } /* AddTraceback */ #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, 0, 0, 0, 0, __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, __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; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } 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_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 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); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 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(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #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_IntOrLong(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_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 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(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #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_IntOrLong(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_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = a->tp_base; if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; if (!res) { res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } return res; } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x02070000 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; } /* InitStrings */ 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 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; if (PyObject_Hash(*t->p) == -1) 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 const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { 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 *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const 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)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #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 int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type %.200s). " "The ability to return an instance of a strict subclass of int " "is deprecated, and may be removed in a future version of Python.", Py_TYPE(result)->tp_name)) { Py_DECREF(result); return NULL; } return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", type_name, type_name, Py_TYPE(result)->tp_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } 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))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ cytoolz-0.10.1/cytoolz/dicttoolz.pxd000066400000000000000000000025301355770264200175420ustar00rootroot00000000000000from cpython.ref cimport PyObject # utility functions to perform iteration over dicts or generic mapping cdef class _iter_mapping: cdef object it cdef object cur ctypedef int (*f_map_next)(object p, Py_ssize_t *ppos, PyObject* *pkey, PyObject* *pval) except -1 cdef f_map_next get_map_iter(object d, PyObject* *ptr) except NULL cdef int PyMapping_Next(object p, Py_ssize_t *ppos, PyObject* *pkey, PyObject* *pval) except -1 cdef object c_merge(object dicts, object factory=*) cdef object c_merge_with(object func, object dicts, object factory=*) cpdef object valmap(object func, object d, object factory=*) cpdef object keymap(object func, object d, object factory=*) cpdef object itemmap(object func, object d, object factory=*) cpdef object valfilter(object predicate, object d, object factory=*) cpdef object keyfilter(object predicate, object d, object factory=*) cpdef object itemfilter(object predicate, object d, object factory=*) cpdef object assoc(object d, object key, object value, object factory=*) cpdef object assoc_in(object d, object keys, object value, object factory=*) cdef object c_dissoc(object d, object keys, object factory=*) cpdef object update_in(object d, object keys, object func, object default=*, object factory=*) cpdef object get_in(object keys, object coll, object default=*, object no_default=*) cytoolz-0.10.1/cytoolz/dicttoolz.pyx000066400000000000000000000362231355770264200175750ustar00rootroot00000000000000from cpython.dict cimport (PyDict_Check, PyDict_CheckExact, PyDict_GetItem, PyDict_Merge, PyDict_New, PyDict_Next, PyDict_SetItem, PyDict_Update, PyDict_DelItem) from cpython.list cimport PyList_Append, PyList_New from cpython.object cimport PyObject_SetItem from cpython.ref cimport PyObject, Py_DECREF, Py_INCREF, Py_XDECREF # Locally defined bindings that differ from `cython.cpython` bindings from cytoolz.cpython cimport PyDict_Next_Compat, PtrIter_Next from copy import copy __all__ = ['merge', 'merge_with', 'valmap', 'keymap', 'itemmap', 'valfilter', 'keyfilter', 'itemfilter', 'assoc', 'dissoc', 'assoc_in', 'get_in', 'update_in'] cdef class _iter_mapping: """ Keep a handle on the current item to prevent memory clean up too early""" def __cinit__(self, object it): self.it = it self.cur = None def __iter__(self): return self def __next__(self): self.cur = next(self.it) return self.cur cdef int PyMapping_Next(object p, Py_ssize_t *ppos, PyObject* *pkey, PyObject* *pval) except -1: """Mimic "PyDict_Next" interface, but for any mapping""" cdef PyObject *obj obj = PtrIter_Next(p) if obj is NULL: return 0 pkey[0] = (obj)[0] pval[0] = (obj)[1] Py_XDECREF(obj) # removing this results in memory leak return 1 cdef f_map_next get_map_iter(object d, PyObject* *ptr) except NULL: """Return function pointer to perform iteration over object returned in ptr. The returned function signature matches "PyDict_Next". If ``d`` is a dict, then the returned function *is* PyDict_Next, so iteration wil be very fast. The object returned through ``ptr`` needs to have its reference count reduced by one once the caller "owns" the object. This function lets us control exactly how iteration should be performed over a given mapping. The current rules are: 1) If ``d`` is exactly a dict, use PyDict_Next 2) If ``d`` is subtype of dict, use PyMapping_Next. This lets the user control the order iteration, such as for ordereddict. 3) If using PyMapping_Next, iterate using ``iteritems`` if possible, otherwise iterate using ``items``. """ cdef object val cdef f_map_next rv if PyDict_CheckExact(d): val = d rv = &PyDict_Next_Compat elif hasattr(d, 'iteritems'): val = _iter_mapping(iter(d.iteritems())) rv = &PyMapping_Next else: val = _iter_mapping(iter(d.items())) rv = &PyMapping_Next Py_INCREF(val) ptr[0] = val return rv cdef get_factory(name, kwargs): factory = kwargs.pop('factory', dict) if kwargs: raise TypeError("{0}() got an unexpected keyword argument " "'{1}'".format(name, kwargs.popitem()[0])) return factory cdef object c_merge(object dicts, object factory=dict): cdef object rv rv = factory() if PyDict_CheckExact(rv): for d in dicts: PyDict_Update(rv, d) else: for d in dicts: rv.update(d) return rv def merge(*dicts, **kwargs): """ Merge a collection of dictionaries >>> merge({1: 'one'}, {2: 'two'}) {1: 'one', 2: 'two'} Later dictionaries have precedence >>> merge({1: 2, 3: 4}, {3: 3, 4: 4}) {1: 2, 3: 3, 4: 4} See Also: merge_with """ if len(dicts) == 1 and not PyDict_Check(dicts[0]): dicts = dicts[0] factory = get_factory('merge', kwargs) return c_merge(dicts, factory) cdef object c_merge_with(object func, object dicts, object factory=dict): cdef: dict result object rv, d list seq f_map_next f PyObject *obj PyObject *pkey PyObject *pval Py_ssize_t pos result = PyDict_New() rv = factory() for d in dicts: f = get_map_iter(d, &obj) d = obj Py_DECREF(d) pos = 0 while f(d, &pos, &pkey, &pval): obj = PyDict_GetItem(result, pkey) if obj is NULL: seq = PyList_New(0) PyList_Append(seq, pval) PyDict_SetItem(result, pkey, seq) else: PyList_Append(obj, pval) f = get_map_iter(result, &obj) d = obj Py_DECREF(d) pos = 0 while f(d, &pos, &pkey, &pval): PyObject_SetItem(rv, pkey, func(pval)) return rv def merge_with(func, *dicts, **kwargs): """ Merge dictionaries and apply function to combined values A key may occur in more than one dict, and all values mapped from the key will be passed to the function as a list, such as func([val1, val2, ...]). >>> merge_with(sum, {1: 1, 2: 2}, {1: 10, 2: 20}) {1: 11, 2: 22} >>> merge_with(first, {1: 1, 2: 2}, {2: 20, 3: 30}) # doctest: +SKIP {1: 1, 2: 2, 3: 30} See Also: merge """ if len(dicts) == 1 and not PyDict_Check(dicts[0]): dicts = dicts[0] factory = get_factory('merge_with', kwargs) return c_merge_with(func, dicts, factory) cpdef object valmap(object func, object d, object factory=dict): """ Apply function to values of dictionary >>> bills = {"Alice": [20, 15, 30], "Bob": [10, 35]} >>> valmap(sum, bills) # doctest: +SKIP {'Alice': 65, 'Bob': 45} See Also: keymap itemmap """ cdef: object rv f_map_next f PyObject *obj PyObject *pkey PyObject *pval Py_ssize_t pos = 0 rv = factory() f = get_map_iter(d, &obj) d = obj Py_DECREF(d) while f(d, &pos, &pkey, &pval): rv[pkey] = func(pval) return rv cpdef object keymap(object func, object d, object factory=dict): """ Apply function to keys of dictionary >>> bills = {"Alice": [20, 15, 30], "Bob": [10, 35]} >>> keymap(str.lower, bills) # doctest: +SKIP {'alice': [20, 15, 30], 'bob': [10, 35]} See Also: valmap itemmap """ cdef: object rv f_map_next f PyObject *obj PyObject *pkey PyObject *pval Py_ssize_t pos = 0 rv = factory() f = get_map_iter(d, &obj) d = obj Py_DECREF(d) while f(d, &pos, &pkey, &pval): rv[func(pkey)] = pval return rv cpdef object itemmap(object func, object d, object factory=dict): """ Apply function to items of dictionary >>> accountids = {"Alice": 10, "Bob": 20} >>> itemmap(reversed, accountids) # doctest: +SKIP {10: "Alice", 20: "Bob"} See Also: keymap valmap """ cdef: object rv, k, v f_map_next f PyObject *obj PyObject *pkey PyObject *pval Py_ssize_t pos = 0 rv = factory() f = get_map_iter(d, &obj) d = obj Py_DECREF(d) while f(d, &pos, &pkey, &pval): k, v = func((pkey, pval)) rv[k] = v return rv cpdef object valfilter(object predicate, object d, object factory=dict): """ Filter items in dictionary by value >>> iseven = lambda x: x % 2 == 0 >>> d = {1: 2, 2: 3, 3: 4, 4: 5} >>> valfilter(iseven, d) {1: 2, 3: 4} See Also: keyfilter itemfilter valmap """ cdef: object rv f_map_next f PyObject *obj PyObject *pkey PyObject *pval Py_ssize_t pos = 0 rv = factory() f = get_map_iter(d, &obj) d = obj Py_DECREF(d) while f(d, &pos, &pkey, &pval): if predicate(pval): rv[pkey] = pval return rv cpdef object keyfilter(object predicate, object d, object factory=dict): """ Filter items in dictionary by key >>> iseven = lambda x: x % 2 == 0 >>> d = {1: 2, 2: 3, 3: 4, 4: 5} >>> keyfilter(iseven, d) {2: 3, 4: 5} See Also: valfilter itemfilter keymap """ cdef: object rv f_map_next f PyObject *obj PyObject *pkey PyObject *pval Py_ssize_t pos = 0 rv = factory() f = get_map_iter(d, &obj) d = obj Py_DECREF(d) while f(d, &pos, &pkey, &pval): if predicate(pkey): rv[pkey] = pval return rv cpdef object itemfilter(object predicate, object d, object factory=dict): """ Filter items in dictionary by item >>> def isvalid(item): ... k, v = item ... return k % 2 == 0 and v < 4 >>> d = {1: 2, 2: 3, 3: 4, 4: 5} >>> itemfilter(isvalid, d) {2: 3} See Also: keyfilter valfilter itemmap """ cdef: object rv, k, v f_map_next f PyObject *obj PyObject *pkey PyObject *pval Py_ssize_t pos = 0 rv = factory() f = get_map_iter(d, &obj) d = obj Py_DECREF(d) while f(d, &pos, &pkey, &pval): k = pkey v = pval if predicate((k, v)): rv[k] = v return rv cpdef object assoc(object d, object key, object value, object factory=dict): """ Return a new dict with new key value pair New dict has d[key] set to value. Does not modify the initial dictionary. >>> assoc({'x': 1}, 'x', 2) {'x': 2} >>> assoc({'x': 1}, 'y', 3) # doctest: +SKIP {'x': 1, 'y': 3} """ cdef object rv rv = factory() if PyDict_CheckExact(rv): PyDict_Update(rv, d) else: rv.update(d) rv[key] = value return rv cpdef object assoc_in(object d, object keys, object value, object factory=dict): """ Return a new dict with new, potentially nested, key value pair >>> purchase = {'name': 'Alice', ... 'order': {'items': ['Apple', 'Orange'], ... 'costs': [0.50, 1.25]}, ... 'credit card': '5555-1234-1234-1234'} >>> assoc_in(purchase, ['order', 'costs'], [0.25, 1.00]) # doctest: +SKIP {'credit card': '5555-1234-1234-1234', 'name': 'Alice', 'order': {'costs': [0.25, 1.00], 'items': ['Apple', 'Orange']}} """ cdef object prevkey, key cdef object rv, inner, dtemp prevkey, keys = keys[0], keys[1:] rv = factory() if PyDict_CheckExact(rv): PyDict_Update(rv, d) else: rv.update(d) inner = rv for key in keys: if prevkey in d: d = d[prevkey] dtemp = factory() if PyDict_CheckExact(dtemp): PyDict_Update(dtemp, d) else: dtemp.update(d) else: d = factory() dtemp = d inner[prevkey] = dtemp prevkey = key inner = dtemp inner[prevkey] = value return rv cdef object c_dissoc(object d, object keys, object factory=dict): # implementation copied from toolz. Not benchmarked. cdef object rv rv = factory() if len(keys) < len(d) * 0.6: rv.update(d) for key in keys: if key in rv: del rv[key] else: remaining = set(d) remaining.difference_update(keys) for k in remaining: rv[k] = d[k] return rv def dissoc(d, *keys, **kwargs): """ Return a new dict with the given key(s) removed. New dict has d[key] deleted for each supplied key. Does not modify the initial dictionary. >>> dissoc({'x': 1, 'y': 2}, 'y') {'x': 1} >>> dissoc({'x': 1, 'y': 2}, 'y', 'x') {} >>> dissoc({'x': 1}, 'y') # Ignores missing keys {'x': 1} """ return c_dissoc(d, keys, get_factory('dissoc', kwargs)) cpdef object update_in(object d, object keys, object func, object default=None, object factory=dict): """ Update value in a (potentially) nested dictionary inputs: d - dictionary on which to operate keys - list or tuple giving the location of the value to be changed in d func - function to operate on that value If keys == [k0,..,kX] and d[k0]..[kX] == v, update_in returns a copy of the original dictionary with v replaced by func(v), but does not mutate the original dictionary. If k0 is not a key in d, update_in creates nested dictionaries to the depth specified by the keys, with the innermost value set to func(default). >>> inc = lambda x: x + 1 >>> update_in({'a': 0}, ['a'], inc) {'a': 1} >>> transaction = {'name': 'Alice', ... 'purchase': {'items': ['Apple', 'Orange'], ... 'costs': [0.50, 1.25]}, ... 'credit card': '5555-1234-1234-1234'} >>> update_in(transaction, ['purchase', 'costs'], sum) # doctest: +SKIP {'credit card': '5555-1234-1234-1234', 'name': 'Alice', 'purchase': {'costs': 1.75, 'items': ['Apple', 'Orange']}} >>> # updating a value when k0 is not in d >>> update_in({}, [1, 2, 3], str, default="bar") {1: {2: {3: 'bar'}}} >>> update_in({1: 'foo'}, [2, 3, 4], inc, 0) {1: 'foo', 2: {3: {4: 1}}} """ cdef object prevkey, key cdef object rv, inner, dtemp prevkey, keys = keys[0], keys[1:] rv = factory() if PyDict_CheckExact(rv): PyDict_Update(rv, d) else: rv.update(d) inner = rv for key in keys: if prevkey in d: d = d[prevkey] dtemp = factory() if PyDict_CheckExact(dtemp): PyDict_Update(dtemp, d) else: dtemp.update(d) else: d = factory() dtemp = d inner[prevkey] = dtemp prevkey = key inner = dtemp if prevkey in d: key = func(d[prevkey]) else: key = func(default) inner[prevkey] = key return rv cdef tuple _get_in_exceptions = (KeyError, IndexError, TypeError) cpdef object get_in(object keys, object coll, object default=None, object no_default=False): """ Returns coll[i0][i1]...[iX] where [i0, i1, ..., iX]==keys. If coll[i0][i1]...[iX] cannot be found, returns ``default``, unless ``no_default`` is specified, then it raises KeyError or IndexError. ``get_in`` is a generalization of ``operator.getitem`` for nested data structures such as dictionaries and lists. >>> transaction = {'name': 'Alice', ... 'purchase': {'items': ['Apple', 'Orange'], ... 'costs': [0.50, 1.25]}, ... 'credit card': '5555-1234-1234-1234'} >>> get_in(['purchase', 'items', 0], transaction) 'Apple' >>> get_in(['name'], transaction) 'Alice' >>> get_in(['purchase', 'total'], transaction) >>> get_in(['purchase', 'items', 'apple'], transaction) >>> get_in(['purchase', 'items', 10], transaction) >>> get_in(['purchase', 'total'], transaction, 0) 0 >>> get_in(['y'], {}, no_default=True) Traceback (most recent call last): ... KeyError: 'y' See Also: itertoolz.get operator.getitem """ cdef object item try: for item in keys: coll = coll[item] return coll except _get_in_exceptions: if no_default: raise return default cytoolz-0.10.1/cytoolz/functoolz.c000066400000000000000000035355061355770264200172220ustar00rootroot00000000000000/* Generated by Cython 0.29.14 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [], "name": "cytoolz.functoolz", "sources": [ "cytoolz/functoolz.pyx" ] }, "module_name": "cytoolz.functoolz" } END: Cython Metadata */ #define PY_SSIZE_T_CLEAN #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 < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else #define CYTHON_ABI "0_29_14" #define CYTHON_HEX_VERSION 0x001D0EF0 #define CYTHON_FUTURE_DIVISION 0 #include #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 #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x02070000 #define HAVE_LONG_LONG #endif #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_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) #endif #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } # else # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int32 uint32_t; #endif #endif #else #include #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) && __cplusplus >= 201103L #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #elif __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__ ) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #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" #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #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) #endif #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_FAST_PYCCALL #define __Pyx_PyFastCFunction_Check(func)\ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 #define PyMem_RawMalloc(n) PyMem_Malloc(n) #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) #define PyMem_RawFree(p) PyMem_Free(p) #endif #if CYTHON_COMPILING_IN_PYSTON #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #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 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) #else #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) #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_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #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) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #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_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) #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])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if 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 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #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 #define PyObject_Unicode PyObject_Str #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_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #else #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #endif #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_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #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 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { \ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ } #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__cytoolz__functoolz #define __PYX_HAVE_API__cytoolz__functoolz /* Early includes */ #include #include #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const 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_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) 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); } #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_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_ASSUME_SAFE_MACROS #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 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(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*) "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) + 1); 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 CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_cython_runtime = NULL; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; 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[] = { "cytoolz/functoolz.pyx", "stringsource", "cytoolz/functoolz.pxd", "type.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_7cytoolz_9functoolz_curry; struct __pyx_obj_7cytoolz_9functoolz__memoize; struct __pyx_obj_7cytoolz_9functoolz_Compose; struct __pyx_obj_7cytoolz_9functoolz_complement; struct __pyx_obj_7cytoolz_9functoolz__juxt_inner; struct __pyx_obj_7cytoolz_9functoolz_excepts; struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct____get__; struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr; struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_2___get__; struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_3___call__; struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr; struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr; struct __pyx_opt_args_7cytoolz_9functoolz_memoize; struct __pyx_t_7cytoolz_9functoolz_partialobject; /* "cytoolz/functoolz.pxd":22 * * * cpdef object memoize(object func, object cache=*, object key=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9functoolz_memoize { int __pyx_n; PyObject *cache; PyObject *key; }; /* "cytoolz/functoolz.pyx":140 * * * cdef struct partialobject: # <<<<<<<<<<<<<< * PyObject _ * PyObject *fn */ struct __pyx_t_7cytoolz_9functoolz_partialobject { PyObject _; PyObject *fn; PyObject *args; PyObject *kw; PyObject *dict; PyObject *weakreflist; }; /* "cytoolz/functoolz.pxd":10 * * * cdef class curry: # <<<<<<<<<<<<<< * cdef readonly object _sigspec * cdef readonly object _has_unknown_args */ struct __pyx_obj_7cytoolz_9functoolz_curry { PyObject_HEAD PyObject *_sigspec; PyObject *_has_unknown_args; PyObject *func; PyObject *args; PyObject *keywords; PyObject *__doc__; PyObject *__name__; PyObject *__module__; PyObject *__qualname__; }; /* "cytoolz/functoolz.pxd":25 * * * cdef class _memoize: # <<<<<<<<<<<<<< * cdef object func * cdef object cache */ struct __pyx_obj_7cytoolz_9functoolz__memoize { PyObject_HEAD PyObject *func; PyObject *cache; PyObject *key; int is_unary; int may_have_kwargs; }; /* "cytoolz/functoolz.pxd":33 * * * cdef class Compose: # <<<<<<<<<<<<<< * cdef public object first * cdef public tuple funcs */ struct __pyx_obj_7cytoolz_9functoolz_Compose { PyObject_HEAD PyObject *first; PyObject *funcs; }; /* "cytoolz/functoolz.pxd":47 * * * cdef class complement: # <<<<<<<<<<<<<< * cdef object func * */ struct __pyx_obj_7cytoolz_9functoolz_complement { PyObject_HEAD PyObject *func; }; /* "cytoolz/functoolz.pxd":51 * * * cdef class _juxt_inner: # <<<<<<<<<<<<<< * cdef public tuple funcs * */ struct __pyx_obj_7cytoolz_9functoolz__juxt_inner { PyObject_HEAD PyObject *funcs; }; /* "cytoolz/functoolz.pxd":67 * * * cdef class excepts: # <<<<<<<<<<<<<< * cdef public object exc * cdef public object func */ struct __pyx_obj_7cytoolz_9functoolz_excepts { PyObject_HEAD PyObject *exc; PyObject *func; PyObject *handler; }; /* "cytoolz/functoolz.pyx":550 * * property __name__: * def __get__(self): # <<<<<<<<<<<<<< * try: * return '_of_'.join( */ struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct____get__ { PyObject_HEAD struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self; }; /* "cytoolz/functoolz.pyx":553 * try: * return '_of_'.join( * f.__name__ for f in reversed((self.first,) + self.funcs) # <<<<<<<<<<<<<< * ) * except AttributeError: */ struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr { PyObject_HEAD struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct____get__ *__pyx_outer_scope; PyObject *__pyx_v_f; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; }; /* "cytoolz/functoolz.pyx":559 * * property __doc__: * def __get__(self): # <<<<<<<<<<<<<< * def composed_doc(*fs): * """Generate a docstring for the composition of fs. */ struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_2___get__ { PyObject_HEAD PyObject *__pyx_v_composed_doc; }; /* "cytoolz/functoolz.pyx":701 * self.funcs = tuple(funcs) * * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< * if kwargs: * return tuple(PyObject_Call(func, args, kwargs) for func in self.funcs) */ struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_3___call__ { PyObject_HEAD PyObject *__pyx_v_args; PyObject *__pyx_v_kwargs; struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *__pyx_v_self; }; /* "cytoolz/functoolz.pyx":703 * def __call__(self, *args, **kwargs): * if kwargs: * return tuple(PyObject_Call(func, args, kwargs) for func in self.funcs) # <<<<<<<<<<<<<< * else: * return tuple(PyObject_CallObject(func, args) for func in self.funcs) */ struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr { PyObject_HEAD struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_3___call__ *__pyx_outer_scope; PyObject *__pyx_v_func; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; }; /* "cytoolz/functoolz.pyx":705 * return tuple(PyObject_Call(func, args, kwargs) for func in self.funcs) * else: * return tuple(PyObject_CallObject(func, args) for func in self.funcs) # <<<<<<<<<<<<<< * * def __reduce__(self): */ struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr { PyObject_HEAD struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_3___call__ *__pyx_outer_scope; PyObject *__pyx_v_func; PyObject *__pyx_t_0; Py_ssize_t __pyx_t_1; }; /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #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); #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 #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) /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* GetItemInt.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 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); /* SliceTupleAndList.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 /* PyCFunctionFastCall.proto */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); #else #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif /* PyObjectCall2Args.proto */ static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* HasAttr.proto */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /* pyfrozenset_new.proto */ static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it); /* py_dict_items.proto */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d); /* UnpackUnboundCMethod.proto */ typedef struct { PyObject *type; PyObject **method_name; PyCFunction func; PyObject *method; int flag; } __Pyx_CachedCFunction; /* CallUnboundCMethod0.proto */ static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_CallUnboundCMethod0(cfunc, self)\ (likely((cfunc)->func) ?\ (likely((cfunc)->flag == METH_NOARGS) ? (*((cfunc)->func))(self, NULL) :\ (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\ (PY_VERSION_HEX >= 0x030700A0 ?\ (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\ (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\ (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\ (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\ (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ? ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\ ((cfunc)->flag == METH_VARARGS ? (*((cfunc)->func))(self, __pyx_empty_tuple) :\ __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\ __Pyx__CallUnboundCMethod0(cfunc, self)) #else #define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self) #endif /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } #define __Pyx_GetModuleGlobalNameUncached(var, name) {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyObjectCallNoArg.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2)) #endif /* PyDictContains.proto */ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { int result = PyDict_Contains(dict, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #define __Pyx_PyObject_Dict_GetItem(obj, name)\ (likely(PyDict_CheckExact(obj)) ?\ __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) #else #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) #endif /* ListAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { Py_INCREF(x); 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 /* StringJoin.proto */ #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); #endif /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* PySequenceContains.proto */ static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) { int result = PySequence_Contains(seq, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* None.proto */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); /* FetchCommonType.proto */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); /* CythonFunction.proto */ #define __Pyx_CyFunction_USED 1 #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; #if PY_VERSION_HEX < 0x030500A0 PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; void *defaults; int defaults_pyobjects; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) #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); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* IncludeStringH.proto */ #include /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ static int __Pyx_setup_reduce(PyObject* type_obj); /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto #define __PYX_HAVE_RT_ImportType_proto enum __Pyx_ImportType_CheckSize { __Pyx_ImportType_CheckSize_Error = 0, __Pyx_ImportType_CheckSize_Warn = 1, __Pyx_ImportType_CheckSize_Ignore = 2 }; static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); #endif /* PatchModuleWithCoroutine.proto */ static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code); /* PatchInspect.proto */ static PyObject* __Pyx_patch_inspect(PyObject* module); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; int code_line; } __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); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* SwapException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); #endif /* PyObjectGetMethod.proto */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); /* PyObjectCallMethod1.proto */ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg); /* CoroutineBase.proto */ typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *); #if CYTHON_USE_EXC_INFO_STACK #define __Pyx_ExcInfoStruct _PyErr_StackItem #else typedef struct { PyObject *exc_type; PyObject *exc_value; PyObject *exc_traceback; } __Pyx_ExcInfoStruct; #endif typedef struct { PyObject_HEAD __pyx_coroutine_body_t body; PyObject *closure; __Pyx_ExcInfoStruct gi_exc_state; PyObject *gi_weakreflist; PyObject *classobj; PyObject *yieldfrom; PyObject *gi_name; PyObject *gi_qualname; PyObject *gi_modulename; PyObject *gi_code; int resume_label; char is_running; } __pyx_CoroutineObject; static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name); static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name); static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self); static int __Pyx_Coroutine_clear(PyObject *self); static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value); static PyObject *__Pyx_Coroutine_Close(PyObject *self); static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args); #if CYTHON_USE_EXC_INFO_STACK #define __Pyx_Coroutine_SwapException(self) #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state) #else #define __Pyx_Coroutine_SwapException(self) {\ __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\ __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\ } #define __Pyx_Coroutine_ResetAndClearException(self) {\ __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\ (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\ } #endif #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue) #else #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\ __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue) #endif static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue); static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state); /* PatchGeneratorABC.proto */ static int __Pyx_patch_abc(void); /* Generator.proto */ #define __Pyx_Generator_USED static PyTypeObject *__pyx_GeneratorType = 0; #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType) #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\ __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name) static PyObject *__Pyx_Generator_Next(PyObject *self); static int __pyx_Generator_init(void); /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'cython' */ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.type' */ static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; /* Module declarations from 'cpython' */ /* Module declarations from 'cpython.object' */ /* Module declarations from 'cpython.dict' */ /* Module declarations from 'cpython.ref' */ /* Module declarations from 'cpython.sequence' */ /* Module declarations from 'cpython.set' */ /* Module declarations from 'cpython.tuple' */ /* Module declarations from 'cytoolz.functoolz' */ static PyTypeObject *__pyx_ptype_7cytoolz_9functoolz_curry = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9functoolz__memoize = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9functoolz_Compose = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9functoolz_complement = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9functoolz__juxt_inner = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9functoolz_excepts = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9functoolz___pyx_scope_struct____get__ = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9functoolz___pyx_scope_struct_2___get__ = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9functoolz___pyx_scope_struct_3___call__ = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr = 0; static PyObject *__pyx_v_7cytoolz_9functoolz__partial = 0; static PyObject *__pyx_f_7cytoolz_9functoolz_identity(PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9functoolz_c_thread_first(PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_7cytoolz_9functoolz_c_thread_last(PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_7cytoolz_9functoolz_memoize(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9functoolz_memoize *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9functoolz_c_compose(PyObject *); /*proto*/ static PyObject *__pyx_f_7cytoolz_9functoolz_c_compose_left(PyObject *); /*proto*/ static PyObject *__pyx_f_7cytoolz_9functoolz_c_pipe(PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_7cytoolz_9functoolz_c_juxt(PyObject *); /*proto*/ static PyObject *__pyx_f_7cytoolz_9functoolz_do(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9functoolz_flip(PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9functoolz_return_none(PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9functoolz__empty_kwargs(void); /*proto*/ static PyObject *__pyx_f_7cytoolz_9functoolz__restore_curry(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9functoolz___pyx_unpickle_excepts__set_state(struct __pyx_obj_7cytoolz_9functoolz_excepts *, PyObject *); /*proto*/ #define __Pyx_MODULE_NAME "cytoolz.functoolz" extern int __pyx_module_is_main_cytoolz__functoolz; int __pyx_module_is_main_cytoolz__functoolz = 0; /* Implementation of 'cytoolz.functoolz' */ static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_id; static PyObject *__pyx_builtin_reversed; static PyObject *__pyx_builtin_NotImplemented; static PyObject *__pyx_builtin_AttributeError; static PyObject *__pyx_builtin_map; static const char __pyx_k_a[] = "a"; static const char __pyx_k_b[] = "b"; static const char __pyx_k_f[] = "f"; static const char __pyx_k_g[] = "g"; static const char __pyx_k_s[] = "(%s)"; static const char __pyx_k_x[] = "x"; static const char __pyx_k__6[] = "."; static const char __pyx_k__7[] = ":"; static const char __pyx_k_do[] = "do"; static const char __pyx_k_fs[] = "fs"; static const char __pyx_k_id[] = "id"; static const char __pyx_k_of[] = "_of_"; static const char __pyx_k_or[] = "_or_"; static const char __pyx_k_PY3[] = "PY3"; static const char __pyx_k__14[] = ", "; static const char __pyx_k__15[] = "*"; static const char __pyx_k_all[] = "__all__"; static const char __pyx_k_cls[] = "cls"; static const char __pyx_k_doc[] = "__doc__"; static const char __pyx_k_exc[] = "exc"; static const char __pyx_k_f_g[] = "{f}({g})"; static const char __pyx_k_key[] = "key"; static const char __pyx_k_map[] = "map"; static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_obj[] = "obj"; static const char __pyx_k_s_s[] = "%s:%s"; static const char __pyx_k_sys[] = "sys"; static const char __pyx_k_val[] = "val"; static const char __pyx_k_PY34[] = "PY34"; static const char __pyx_k_args[] = "args"; static const char __pyx_k_attr[] = "attr"; static const char __pyx_k_bind[] = "bind"; static const char __pyx_k_call[] = "call"; static const char __pyx_k_data[] = "data"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_flip[] = "flip"; static const char __pyx_k_func[] = "func"; static const char __pyx_k_imap[] = "imap"; static const char __pyx_k_inst[] = "inst"; static const char __pyx_k_join[] = "join"; static const char __pyx_k_juxt[] = "juxt"; static const char __pyx_k_kind[] = "kind"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_pipe[] = "pipe"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_send[] = "send"; static const char __pyx_k_sigs[] = "_sigs"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_apply[] = "apply"; static const char __pyx_k_attrs[] = "attrs"; static const char __pyx_k_cache[] = "cache"; static const char __pyx_k_close[] = "close"; static const char __pyx_k_curry[] = ""; static const char __pyx_k_empty[] = "empty"; static const char __pyx_k_first[] = "first"; static const char __pyx_k_forms[] = "forms"; static const char __pyx_k_funcs[] = "funcs"; static const char __pyx_k_items[] = "items"; static const char __pyx_k_split[] = "split"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_throw[] = "throw"; static const char __pyx_k_types[] = "types"; static const char __pyx_k_dedent[] = "dedent"; static const char __pyx_k_dict_2[] = "_dict"; static const char __pyx_k_filter[] = "filter"; static const char __pyx_k_flip_2[] = "_flip"; static const char __pyx_k_format[] = "format"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_kwargs[] = "kwargs"; static const char __pyx_k_lambda[] = ""; static const char __pyx_k_module[] = "__module__"; static const char __pyx_k_name_2[] = "name"; static const char __pyx_k_pickle[] = "pickle"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_rsplit[] = "rsplit"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_values[] = "values"; static const char __pyx_k_Compose[] = "Compose"; static const char __pyx_k_compose[] = "compose"; static const char __pyx_k_curry_2[] = "curry"; static const char __pyx_k_default[] = "default"; static const char __pyx_k_excepts[] = "excepts"; static const char __pyx_k_genexpr[] = "genexpr"; static const char __pyx_k_handler[] = "handler"; static const char __pyx_k_ifilter[] = "ifilter"; static const char __pyx_k_inspect[] = "inspect"; static const char __pyx_k_memoize[] = "_memoize"; static const char __pyx_k_modname[] = "modname"; static const char __pyx_k_partial[] = "partial"; static const char __pyx_k_replace[] = "replace"; static const char __pyx_k_sigspec[] = "sigspec"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_identity[] = "identity"; static const char __pyx_k_is_arity[] = "is_arity"; static const char __pyx_k_keywords[] = "keywords"; static const char __pyx_k_operator[] = "operator"; static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_qualname[] = "__qualname__"; static const char __pyx_k_reduce_2[] = "reduce"; static const char __pyx_k_reversed[] = "reversed"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_textwrap[] = "textwrap"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_excepting[] = "excepting"; static const char __pyx_k_functools[] = "functools"; static const char __pyx_k_memoize_2[] = "memoize"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_signature[] = "signature"; static const char __pyx_k_MethodType[] = "MethodType"; static const char __pyx_k_attrgetter[] = "attrgetter"; static const char __pyx_k_complement[] = "complement"; static const char __pyx_k_curry_bind[] = "curry.bind"; static const char __pyx_k_curry_call[] = "curry.call"; static const char __pyx_k_juxt_inner[] = "_juxt_inner"; static const char __pyx_k_no_default[] = "no_default"; static const char __pyx_k_parameters[] = "parameters"; static const char __pyx_k_pyx_result[] = "__pyx_result"; static const char __pyx_k_qualname_2[] = "qualname"; static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_VAR_KEYWORD[] = "VAR_KEYWORD"; static const char __pyx_k_args_kwargs[] = "*args, **kwargs"; static const char __pyx_k_do_line_737[] = "do (line 737)"; static const char __pyx_k_has_varargs[] = "has_varargs"; static const char __pyx_k_return_none[] = "return_none"; static const char __pyx_k_thread_last[] = "thread_last"; static const char __pyx_k_KEYWORD_ONLY[] = "KEYWORD_ONLY"; static const char __pyx_k_compose_left[] = "compose_left"; static const char __pyx_k_composed_doc[] = "composed_doc"; static const char __pyx_k_has_keywords[] = "has_keywords"; static const char __pyx_k_is_decorated[] = "is_decorated"; static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; static const char __pyx_k_should_curry[] = "_should_curry"; static const char __pyx_k_stringsource[] = "stringsource"; static const char __pyx_k_thread_first[] = "thread_first"; static const char __pyx_k_use_setstate[] = "use_setstate"; static const char __pyx_k_apply_line_34[] = "apply (line 34)"; static const char __pyx_k_cytoolz_utils[] = "cytoolz.utils"; static const char __pyx_k_flip_line_764[] = "flip (line 764)"; static const char __pyx_k_func_and_args[] = "func_and_args"; static const char __pyx_k_import_module[] = "import_module"; static const char __pyx_k_is_valid_args[] = "is_valid_args"; static const char __pyx_k_juxt_line_715[] = "juxt (line 715)"; static const char __pyx_k_pipe_line_648[] = "pipe (line 648)"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_restore_curry[] = "_restore_curry"; static const char __pyx_k_AttributeError[] = "AttributeError"; static const char __pyx_k_NotImplemented[] = "NotImplemented"; static const char __pyx_k_VAR_POSITIONAL[] = "VAR_POSITIONAL"; static const char __pyx_k_curry___reduce[] = "curry.__reduce__"; static const char __pyx_k_s_excepting__s[] = "%s_excepting_%s"; static const char __pyx_k_is_partial_args[] = "is_partial_args"; static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_toolz_functoolz[] = "toolz.functoolz"; static const char __pyx_k_Compose___reduce[] = "Compose.__reduce__"; static const char __pyx_k_InstanceProperty[] = "InstanceProperty"; static const char __pyx_k_compose_line_588[] = "compose (line 588)"; static const char __pyx_k_cytooz_functoolz[] = "cytooz.functoolz"; static const char __pyx_k_instanceproperty[] = "instanceproperty"; static const char __pyx_k_memoize_line_391[] = "memoize (line 391)"; static const char __pyx_k_cytoolz_functoolz[] = "cytoolz.functoolz"; static const char __pyx_k_num_required_args[] = "num_required_args"; static const char __pyx_k_return_annotation[] = "return_annotation"; static const char __pyx_k_signature_or_spec[] = "signature_or_spec"; static const char __pyx_k_Compose___setstate[] = "Compose.__setstate__"; static const char __pyx_k_class_____name___r[] = "{.__class__.__name__}{!r}"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_lambda_args_kwargs[] = "lambda *args, **kwargs: "; static const char __pyx_k_complement___reduce[] = "complement.__reduce__"; static const char __pyx_k_curry__should_curry[] = "curry._should_curry"; static const char __pyx_k_cytoolz__signatures[] = "cytoolz._signatures"; static const char __pyx_k_juxt_inner___reduce[] = "_juxt_inner.__reduce__"; static const char __pyx_k_pyx_unpickle_excepts[] = "__pyx_unpickle_excepts"; static const char __pyx_k_thread_first_line_65[] = "thread_first (line 65)"; static const char __pyx_k_thread_last_line_107[] = "thread_last (line 107)"; static const char __pyx_k_call___locals_genexpr[] = "__call__..genexpr"; static const char __pyx_k_compose_left_line_619[] = "compose_left (line 619)"; static const char __pyx_k_cytoolz_compatibility[] = "cytoolz.compatibility"; static const char __pyx_k_cytoolz_functoolz_pyx[] = "cytoolz/functoolz.pyx"; static const char __pyx_k_should_curry_internal[] = "_should_curry_internal"; static const char __pyx_k_Input_must_be_callable[] = "Input must be callable"; static const char __pyx_k_excepts___reduce_cython[] = "excepts.__reduce_cython__"; static const char __pyx_k_memoize___reduce_cython[] = "_memoize.__reduce_cython__"; static const char __pyx_k_excepts___setstate_cython[] = "excepts.__setstate_cython__"; static const char __pyx_k_func_argument_is_required[] = "func argument is required"; static const char __pyx_k_memoize___setstate_cython[] = "_memoize.__setstate_cython__"; static const char __pyx_k_A_composition_of_functions[] = "A composition of functions"; static const char __pyx_k_curry__should_curry_internal[] = "curry._should_curry_internal"; static const char __pyx_k_Applies_a_function_and_returns[] = "\n Applies a function and returns the results\n\n >>> def double(x): return 2*x\n >>> def inc(x): return x + 1\n >>> apply(double, 5)\n 10\n\n >>> tuple(map(apply, [double, inc, double], [10, 500, 8000]))\n (20, 501, 16000)\n "; static const char __pyx_k_Compose___get___locals_genexpr[] = "Compose.__get__..genexpr"; static const char __pyx_k_init___takes_at_least_2_argume[] = "__init__() takes at least 2 arguments (1 given)"; static const char __pyx_k_A_wrapper_around_inst_func___na[] = " A wrapper around {inst.func.__name__!r} that will except:\n {exc}\n and handle any exceptions with {inst.handler.__name__!r}.\n\n Docs for {inst.func.__name__!r}:\n {inst.func.__doc__}\n\n Docs for {inst.handler.__name__!r}:\n {inst.handler.__doc__}\n "; static const char __pyx_k_Cache_a_function_s_result_for_s[] = "\n Cache a function's result for speedy future evaluation\n\n Considerations:\n Trades memory for speed.\n Only use on pure functions.\n\n >>> def add(x, y): return x + y\n >>> add = memoize(add)\n\n Or use as a decorator\n\n >>> @memoize\n ... def add(x, y):\n ... return x + y\n\n Use the ``cache`` keyword to provide a dict-like object as an initial cache\n\n >>> @memoize(cache={(1, 2): 3})\n ... def add(x, y):\n ... return x + y\n\n Note that the above works as a decorator because ``memoize`` is curried.\n\n It is also possible to provide a ``key(args, kwargs)`` function that\n calculates keys used for the cache, which receives an ``args`` tuple and\n ``kwargs`` dict as input, and must return a hashable value. However,\n the default key function should be sufficient most of the time.\n\n >>> # Use key function that ignores extraneous keyword arguments\n >>> @memoize(key=lambda args, kwargs: args)\n ... def add(x, y, verbose=False):\n ... if verbose:\n ... print('Calculating %s + %s' % (x, y))\n ... return x + y\n "; static const char __pyx_k_Call_the_function_call_with_the[] = "\n Call the function call with the arguments flipped\n\n This function is curried.\n\n >>> def div(a, b):\n ... return a // b\n ...\n >>> flip(div, 2, 6)\n 3\n >>> div_by_two = flip(div, 2)\n >>> div_by_two(4)\n 2\n\n This is particularly useful for built in functions and functions defined\n in C extensions that accept positional only arguments. For example:\n isinstance, issubclass.\n\n >>> data = [1, 'a', 'b', 2, 1.5, object(), 3]\n >>> only_ints = list(filter(flip(isinstance, int), data))\n >>> only_ints\n [1, 2, 3]\n "; static const char __pyx_k_Compose___get___locals_composed[] = "Compose.__get__..composed_doc"; static const char __pyx_k_Compose_functions_to_operate_in[] = "\n Compose functions to operate in series.\n\n Returns a function that applies other functions in sequence.\n\n Functions are applied from right to left so that\n ``compose(f, g, h)(x, y)`` is the same as ``f(g(h(x, y)))``.\n\n If no arguments are provided, the identity function (f(x) = x) is returned.\n\n >>> inc = lambda i: i + 1\n >>> compose(str, inc)(3)\n '4'\n\n See Also:\n compose_left\n pipe\n "; static const char __pyx_k_Creates_a_function_that_calls_s[] = "\n Creates a function that calls several functions with the same arguments\n\n Takes several functions and returns a function that applies its arguments\n to each of those functions then returns a tuple of the results.\n\n Name comes from juxtaposition: the fact of two things being seen or placed\n close together with contrasting effect.\n\n >>> inc = lambda x: x + 1\n >>> double = lambda x: x * 2\n >>> juxt(inc, double)(10)\n (11, 20)\n >>> juxt([inc, double])(10)\n (11, 20)\n "; static const char __pyx_k_Pipe_a_value_through_a_sequence[] = "\n Pipe a value through a sequence of functions\n\n I.e. ``pipe(data, f, g, h)`` is equivalent to ``h(g(f(data)))``\n\n We think of the value as progressing through a pipe of several\n transformations, much like pipes in UNIX\n\n ``$ cat data | f | g | h``\n\n >>> double = lambda i: 2 * i\n >>> pipe(3, double, str)\n '6'\n\n See Also:\n compose\n compose_left\n thread_first\n thread_last\n "; static const char __pyx_k_Runs_func_on_x_returns_x_Becaus[] = "\n Runs ``func`` on ``x``, returns ``x``\n\n Because the results of ``func`` are not returned, only the side\n effects of ``func`` are relevant.\n\n Logging functions can be made by composing ``do`` with a storage function\n like ``list.append`` or ``file.write``\n\n >>> from cytoolz import compose\n >>> from cytoolz.curried import do\n\n >>> log = []\n >>> inc = lambda x: x + 1\n >>> inc = compose(inc, do(log.append))\n >>> inc(1)\n 2\n >>> inc(11)\n 12\n >>> log\n [1, 11]\n "; static const char __pyx_k_Thread_value_through_a_sequence[] = "\n Thread value through a sequence of functions/forms\n\n >>> def double(x): return 2*x\n >>> def inc(x): return x + 1\n >>> thread_first(1, inc, double)\n 4\n\n If the function expects more than one input you can specify those inputs\n in a tuple. The value is used as the first input.\n\n >>> def add(x, y): return x + y\n >>> def pow(x, y): return x**y\n >>> thread_first(1, (add, 4), (pow, 2)) # pow(add(1, 4), 2)\n 25\n\n So in general\n thread_first(x, f, (g, y, z))\n expands to\n g(f(x), y, z)\n\n See Also:\n thread_last\n "; static const char __pyx_k_Incompatible_checksums_s_vs_0x75[] = "Incompatible checksums (%s vs 0x75ac63f = (exc, func, handler))"; static const char __pyx_k_curry_object_has_incorrect_argum[] = "curry object has incorrect arguments"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; static const char __pyx_k_Compose_functions_to_operate_in_2[] = "\n Compose functions to operate in series.\n\n Returns a function that applies other functions in sequence.\n\n Functions are applied from left to right so that\n ``compose_left(f, g, h)(x, y)`` is the same as ``h(g(f(x, y)))``.\n\n If no arguments are provided, the identity function (f(x) = x) is returned.\n\n >>> inc = lambda i: i + 1\n >>> compose_left(inc, str)(3)\n '4'\n\n See Also:\n compose\n pipe\n "; static const char __pyx_k_Thread_value_through_a_sequence_2[] = "\n Thread value through a sequence of functions/forms\n\n >>> def double(x): return 2*x\n >>> def inc(x): return x + 1\n >>> thread_last(1, inc, double)\n 4\n\n If the function expects more than one input you can specify those inputs\n in a tuple. The value is used as the last input.\n\n >>> def add(x, y): return x + y\n >>> def pow(x, y): return x**y\n >>> thread_last(1, (add, 4), (pow, 2)) # pow(2, add(4, 1))\n 32\n\n So in general\n thread_last(x, f, (g, y, z))\n expands to\n g(y, z, f(x))\n\n >>> def iseven(x):\n ... return x % 2 == 0\n >>> list(thread_last([1, 2, 3], (map, inc), (filter, iseven)))\n [2, 4]\n\n See Also:\n thread_first\n "; static PyObject *__pyx_kp_s_A_composition_of_functions; static PyObject *__pyx_kp_s_A_wrapper_around_inst_func___na; static PyObject *__pyx_kp_u_Applies_a_function_and_returns; static PyObject *__pyx_n_s_AttributeError; static PyObject *__pyx_kp_u_Cache_a_function_s_result_for_s; static PyObject *__pyx_kp_u_Call_the_function_call_with_the; static PyObject *__pyx_n_s_Compose; static PyObject *__pyx_n_s_Compose___get___locals_composed; static PyObject *__pyx_n_s_Compose___get___locals_genexpr; static PyObject *__pyx_n_s_Compose___reduce; static PyObject *__pyx_n_s_Compose___setstate; static PyObject *__pyx_kp_u_Compose_functions_to_operate_in; static PyObject *__pyx_kp_u_Compose_functions_to_operate_in_2; static PyObject *__pyx_kp_u_Creates_a_function_that_calls_s; static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x75; static PyObject *__pyx_kp_s_Input_must_be_callable; static PyObject *__pyx_n_s_InstanceProperty; static PyObject *__pyx_n_s_KEYWORD_ONLY; static PyObject *__pyx_n_s_MethodType; static PyObject *__pyx_n_s_NotImplemented; static PyObject *__pyx_n_s_PY3; static PyObject *__pyx_n_s_PY34; static PyObject *__pyx_n_s_PickleError; static PyObject *__pyx_kp_u_Pipe_a_value_through_a_sequence; static PyObject *__pyx_kp_u_Runs_func_on_x_returns_x_Becaus; static PyObject *__pyx_kp_u_Thread_value_through_a_sequence; static PyObject *__pyx_kp_u_Thread_value_through_a_sequence_2; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_VAR_KEYWORD; static PyObject *__pyx_n_s_VAR_POSITIONAL; static PyObject *__pyx_kp_s__14; static PyObject *__pyx_n_s__15; static PyObject *__pyx_kp_s__6; static PyObject *__pyx_kp_s__7; static PyObject *__pyx_n_s_a; static PyObject *__pyx_n_s_all; static PyObject *__pyx_n_s_apply; static PyObject *__pyx_kp_u_apply_line_34; static PyObject *__pyx_n_s_args; static PyObject *__pyx_kp_s_args_kwargs; static PyObject *__pyx_n_s_attr; static PyObject *__pyx_n_s_attrgetter; static PyObject *__pyx_n_s_attrs; static PyObject *__pyx_n_s_b; static PyObject *__pyx_n_s_bind; static PyObject *__pyx_n_s_cache; static PyObject *__pyx_n_s_call; static PyObject *__pyx_n_s_call___locals_genexpr; static PyObject *__pyx_kp_s_class_____name___r; static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_close; static PyObject *__pyx_n_s_cls; static PyObject *__pyx_n_s_complement; static PyObject *__pyx_n_s_complement___reduce; static PyObject *__pyx_n_s_compose; static PyObject *__pyx_n_s_compose_left; static PyObject *__pyx_kp_u_compose_left_line_619; static PyObject *__pyx_kp_u_compose_line_588; static PyObject *__pyx_n_s_composed_doc; static PyObject *__pyx_kp_s_curry; static PyObject *__pyx_n_s_curry_2; static PyObject *__pyx_n_s_curry___reduce; static PyObject *__pyx_n_s_curry__should_curry; static PyObject *__pyx_n_s_curry__should_curry_internal; static PyObject *__pyx_n_s_curry_bind; static PyObject *__pyx_n_s_curry_call; static PyObject *__pyx_kp_s_curry_object_has_incorrect_argum; static PyObject *__pyx_n_s_cytoolz__signatures; static PyObject *__pyx_n_s_cytoolz_compatibility; static PyObject *__pyx_n_s_cytoolz_functoolz; static PyObject *__pyx_kp_s_cytoolz_functoolz_pyx; static PyObject *__pyx_n_s_cytoolz_utils; static PyObject *__pyx_kp_s_cytooz_functoolz; static PyObject *__pyx_n_s_data; static PyObject *__pyx_n_s_dedent; static PyObject *__pyx_n_s_default; static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_dict_2; static PyObject *__pyx_n_s_do; static PyObject *__pyx_kp_u_do_line_737; static PyObject *__pyx_n_s_doc; static PyObject *__pyx_n_s_empty; static PyObject *__pyx_n_s_exc; static PyObject *__pyx_n_s_excepting; static PyObject *__pyx_n_s_excepts; static PyObject *__pyx_n_s_excepts___reduce_cython; static PyObject *__pyx_n_s_excepts___setstate_cython; static PyObject *__pyx_n_s_f; static PyObject *__pyx_kp_s_f_g; static PyObject *__pyx_n_s_filter; static PyObject *__pyx_n_s_first; static PyObject *__pyx_n_s_flip; static PyObject *__pyx_n_s_flip_2; static PyObject *__pyx_kp_u_flip_line_764; static PyObject *__pyx_n_s_format; static PyObject *__pyx_n_s_forms; static PyObject *__pyx_n_s_fs; static PyObject *__pyx_n_s_func; static PyObject *__pyx_n_s_func_and_args; static PyObject *__pyx_kp_s_func_argument_is_required; static PyObject *__pyx_n_s_funcs; static PyObject *__pyx_n_s_functools; static PyObject *__pyx_n_s_g; static PyObject *__pyx_n_s_genexpr; static PyObject *__pyx_n_s_getstate; static PyObject *__pyx_n_s_handler; static PyObject *__pyx_n_s_has_keywords; static PyObject *__pyx_n_s_has_varargs; static PyObject *__pyx_n_s_id; static PyObject *__pyx_n_s_identity; static PyObject *__pyx_n_s_ifilter; static PyObject *__pyx_n_s_imap; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_import_module; static PyObject *__pyx_kp_s_init___takes_at_least_2_argume; static PyObject *__pyx_n_s_inspect; static PyObject *__pyx_n_s_inst; static PyObject *__pyx_n_s_instanceproperty; static PyObject *__pyx_n_s_is_arity; static PyObject *__pyx_n_s_is_decorated; static PyObject *__pyx_n_s_is_partial_args; static PyObject *__pyx_n_s_is_valid_args; static PyObject *__pyx_n_s_items; static PyObject *__pyx_n_s_join; static PyObject *__pyx_n_s_juxt; static PyObject *__pyx_n_s_juxt_inner; static PyObject *__pyx_n_s_juxt_inner___reduce; static PyObject *__pyx_kp_u_juxt_line_715; static PyObject *__pyx_n_s_key; static PyObject *__pyx_n_s_keywords; static PyObject *__pyx_n_s_kind; static PyObject *__pyx_n_s_kwargs; static PyObject *__pyx_n_s_lambda; static PyObject *__pyx_kp_s_lambda_args_kwargs; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_map; static PyObject *__pyx_n_s_memoize; static PyObject *__pyx_n_s_memoize_2; static PyObject *__pyx_n_s_memoize___reduce_cython; static PyObject *__pyx_n_s_memoize___setstate_cython; static PyObject *__pyx_kp_u_memoize_line_391; static PyObject *__pyx_n_s_modname; static PyObject *__pyx_n_s_module; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_name_2; static PyObject *__pyx_n_s_new; static PyObject *__pyx_n_s_no_default; static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; static PyObject *__pyx_n_s_num_required_args; static PyObject *__pyx_n_s_obj; static PyObject *__pyx_n_s_of; static PyObject *__pyx_n_s_operator; static PyObject *__pyx_n_s_or; static PyObject *__pyx_n_s_parameters; static PyObject *__pyx_n_s_partial; static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_n_s_pipe; static PyObject *__pyx_kp_u_pipe_line_648; static PyObject *__pyx_n_s_pyx_PickleError; static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_result; static PyObject *__pyx_n_s_pyx_state; static PyObject *__pyx_n_s_pyx_type; static PyObject *__pyx_n_s_pyx_unpickle_excepts; static PyObject *__pyx_n_s_qualname; static PyObject *__pyx_n_s_qualname_2; static PyObject *__pyx_n_s_reduce; static PyObject *__pyx_n_s_reduce_2; static PyObject *__pyx_n_s_reduce_cython; static PyObject *__pyx_n_s_reduce_ex; static PyObject *__pyx_n_s_replace; static PyObject *__pyx_n_s_restore_curry; static PyObject *__pyx_n_s_return_annotation; static PyObject *__pyx_n_s_return_none; static PyObject *__pyx_n_s_reversed; static PyObject *__pyx_n_s_rsplit; static PyObject *__pyx_kp_s_s; static PyObject *__pyx_kp_s_s_excepting__s; static PyObject *__pyx_kp_s_s_s; static PyObject *__pyx_n_s_self; static PyObject *__pyx_n_s_send; static PyObject *__pyx_n_s_setstate; static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_should_curry; static PyObject *__pyx_n_s_should_curry_internal; static PyObject *__pyx_n_s_signature; static PyObject *__pyx_n_s_signature_or_spec; static PyObject *__pyx_n_s_sigs; static PyObject *__pyx_n_s_sigspec; static PyObject *__pyx_n_s_split; static PyObject *__pyx_n_s_state; static PyObject *__pyx_kp_s_stringsource; static PyObject *__pyx_n_s_sys; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_textwrap; static PyObject *__pyx_n_s_thread_first; static PyObject *__pyx_kp_u_thread_first_line_65; static PyObject *__pyx_n_s_thread_last; static PyObject *__pyx_kp_u_thread_last_line_107; static PyObject *__pyx_n_s_throw; static PyObject *__pyx_n_s_toolz_functoolz; static PyObject *__pyx_n_s_types; static PyObject *__pyx_n_s_update; static PyObject *__pyx_n_s_use_setstate; static PyObject *__pyx_n_s_val; static PyObject *__pyx_n_s_values; static PyObject *__pyx_n_s_x; static PyObject *__pyx_lambda_funcdef_7cytoolz_9functoolz_lambda(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_identity(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_2apply(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func_and_args, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_4thread_first(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val, PyObject *__pyx_v_forms); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_6thread_last(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val, PyObject *__pyx_v_forms); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_5curry___cinit__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_2__str__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_4__repr__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self); /* proto */ static Py_hash_t __pyx_pf_7cytoolz_9functoolz_5curry_6__hash__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_8__richcmp__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_10__call__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_12_should_curry(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_14_should_curry_internal(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_exc); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_16bind(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_18call(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_20__get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self, PyObject *__pyx_v_instance, CYTHON_UNUSED PyObject *__pyx_v_owner); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_13__signature_____get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_22__reduce__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_8_sigspec___get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_17_has_unknown_args___get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_4func___get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_4args___get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_8keywords___get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_7__doc_____get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_5curry_7__doc___2__set__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_5curry_7__doc___4__del__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_8__name_____get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_5curry_8__name___2__set__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_5curry_8__name___4__del__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_10__module_____get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_5curry_10__module___2__set__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_5curry_10__module___4__del__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_12__qualname_____get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_5curry_12__qualname___2__set__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_5curry_12__qualname___4__del__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_8_restore_curry(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, PyObject *__pyx_v_is_decorated); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_10memoize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_cache, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_8_memoize_7__doc_____get__(struct __pyx_obj_7cytoolz_9functoolz__memoize *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_8_memoize_8__name_____get__(struct __pyx_obj_7cytoolz_9functoolz__memoize *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_8_memoize_11__wrapped_____get__(struct __pyx_obj_7cytoolz_9functoolz__memoize *__pyx_v_self); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_8_memoize___cinit__(struct __pyx_obj_7cytoolz_9functoolz__memoize *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_cache, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_8_memoize_2__call__(struct __pyx_obj_7cytoolz_9functoolz__memoize *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_8_memoize_4__get__(struct __pyx_obj_7cytoolz_9functoolz__memoize *__pyx_v_self, PyObject *__pyx_v_instance, CYTHON_UNUSED PyObject *__pyx_v_owner); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_8_memoize_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9functoolz__memoize *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_8_memoize_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9functoolz__memoize *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_7Compose___cinit__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self, PyObject *__pyx_v_funcs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_2__call__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_4__reduce__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_6__setstate__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self, PyObject *__pyx_v_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_8__repr__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_10__eq__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_12__ne__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self, PyObject *__pyx_v_other); /* proto */ static Py_hash_t __pyx_pf_7cytoolz_9functoolz_7Compose_14__hash__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_16__get__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_objtype); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_11__wrapped_____get__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_13__signature_____get__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_8__name___7__get___genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_8__name_____get__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_7__doc___7__get___composed_doc(PyObject *__pyx_self, PyObject *__pyx_v_fs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_7__doc_____get__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_5first___get__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_7Compose_5first_2__set__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_7Compose_5first_4__del__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_5funcs___get__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_7Compose_5funcs_2__set__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_7Compose_5funcs_4__del__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_12compose(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_funcs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_14compose_left(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_funcs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_16pipe(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_funcs); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_10complement___cinit__(struct __pyx_obj_7cytoolz_9functoolz_complement *__pyx_v_self, PyObject *__pyx_v_func); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_10complement_2__call__(struct __pyx_obj_7cytoolz_9functoolz_complement *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_10complement_4__reduce__(struct __pyx_obj_7cytoolz_9functoolz_complement *__pyx_v_self); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_11_juxt_inner___cinit__(struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *__pyx_v_self, PyObject *__pyx_v_funcs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_11_juxt_inner_8__call___genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_11_juxt_inner_8__call___3genexpr(PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_11_juxt_inner_2__call__(struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_11_juxt_inner_4__reduce__(struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_11_juxt_inner_5funcs___get__(struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *__pyx_v_self); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_11_juxt_inner_5funcs_2__set__(struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_11_juxt_inner_5funcs_4__del__(struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_18juxt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_funcs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_20do(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_22flip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_a, PyObject *__pyx_v_b); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_24return_none(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_exc); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_7excepts___init__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self, PyObject *__pyx_v_exc, PyObject *__pyx_v_func, PyObject *__pyx_v_handler); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7excepts_2__call__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7excepts_8__name_____get__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7excepts_7__doc_____get__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7excepts_3exc___get__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_7excepts_3exc_2__set__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_7excepts_3exc_4__del__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7excepts_4func___get__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_7excepts_4func_2__set__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_7excepts_4func_4__del__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7excepts_7handler___get__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_7excepts_7handler_2__set__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ static int __pyx_pf_7cytoolz_9functoolz_7excepts_7handler_4__del__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7excepts_4__reduce_cython__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7excepts_6__setstate_cython__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9functoolz_27__pyx_unpickle_excepts(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_7cytoolz_9functoolz_curry(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9functoolz__memoize(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9functoolz_Compose(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9functoolz_complement(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9functoolz__juxt_inner(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9functoolz_excepts(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9functoolz___pyx_scope_struct____get__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9functoolz___pyx_scope_struct_2___get__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9functoolz___pyx_scope_struct_3___call__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items = {0, &__pyx_n_s_items, 0, 0, 0}; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_123389503; static PyObject *__pyx_k__13; static PyObject *__pyx_tuple_; static PyObject *__pyx_slice__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__4; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__8; static PyObject *__pyx_tuple__9; static PyObject *__pyx_tuple__10; static PyObject *__pyx_tuple__11; static PyObject *__pyx_tuple__16; static PyObject *__pyx_tuple__18; static PyObject *__pyx_tuple__20; static PyObject *__pyx_tuple__22; static PyObject *__pyx_tuple__24; static PyObject *__pyx_tuple__26; static PyObject *__pyx_tuple__28; static PyObject *__pyx_tuple__30; static PyObject *__pyx_tuple__32; static PyObject *__pyx_tuple__34; static PyObject *__pyx_tuple__36; static PyObject *__pyx_tuple__38; static PyObject *__pyx_tuple__40; static PyObject *__pyx_tuple__42; static PyObject *__pyx_tuple__44; static PyObject *__pyx_tuple__46; static PyObject *__pyx_tuple__48; static PyObject *__pyx_tuple__50; static PyObject *__pyx_tuple__52; static PyObject *__pyx_tuple__54; static PyObject *__pyx_tuple__56; static PyObject *__pyx_tuple__58; static PyObject *__pyx_tuple__60; static PyObject *__pyx_tuple__62; static PyObject *__pyx_tuple__64; static PyObject *__pyx_tuple__66; static PyObject *__pyx_tuple__68; static PyObject *__pyx_codeobj__12; static PyObject *__pyx_codeobj__17; static PyObject *__pyx_codeobj__19; static PyObject *__pyx_codeobj__21; static PyObject *__pyx_codeobj__23; static PyObject *__pyx_codeobj__25; static PyObject *__pyx_codeobj__27; static PyObject *__pyx_codeobj__29; static PyObject *__pyx_codeobj__31; static PyObject *__pyx_codeobj__33; static PyObject *__pyx_codeobj__35; static PyObject *__pyx_codeobj__37; static PyObject *__pyx_codeobj__39; static PyObject *__pyx_codeobj__41; static PyObject *__pyx_codeobj__43; static PyObject *__pyx_codeobj__45; static PyObject *__pyx_codeobj__47; static PyObject *__pyx_codeobj__49; static PyObject *__pyx_codeobj__51; static PyObject *__pyx_codeobj__53; static PyObject *__pyx_codeobj__55; static PyObject *__pyx_codeobj__57; static PyObject *__pyx_codeobj__59; static PyObject *__pyx_codeobj__61; static PyObject *__pyx_codeobj__63; static PyObject *__pyx_codeobj__65; static PyObject *__pyx_codeobj__67; static PyObject *__pyx_codeobj__69; /* Late includes */ /* "cytoolz/functoolz.pyx":149 * * * cdef object _partial = partial(lambda: None) # <<<<<<<<<<<<<< * * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_26lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_26lambda = {"lambda", (PyCFunction)__pyx_pw_7cytoolz_9functoolz_26lambda, METH_NOARGS, 0}; static PyObject *__pyx_pw_7cytoolz_9functoolz_26lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda (wrapper)", 0); __pyx_r = __pyx_lambda_funcdef_7cytoolz_9functoolz_lambda(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_lambda_funcdef_7cytoolz_9functoolz_lambda(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("lambda", 0); __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":30 * * * cpdef object identity(object x): # <<<<<<<<<<<<<< * return x * */ static PyObject *__pyx_pw_7cytoolz_9functoolz_1identity(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ static PyObject *__pyx_f_7cytoolz_9functoolz_identity(PyObject *__pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("identity", 0); /* "cytoolz/functoolz.pyx":31 * * cpdef object identity(object x): * return x # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_x); __pyx_r = __pyx_v_x; goto __pyx_L0; /* "cytoolz/functoolz.pyx":30 * * * cpdef object identity(object x): # <<<<<<<<<<<<<< * return x * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_1identity(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_identity[] = "identity(x)"; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_1identity = {"identity", (PyCFunction)__pyx_pw_7cytoolz_9functoolz_1identity, METH_O, __pyx_doc_7cytoolz_9functoolz_identity}; static PyObject *__pyx_pw_7cytoolz_9functoolz_1identity(PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("identity (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_identity(__pyx_self, ((PyObject *)__pyx_v_x)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_identity(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("identity", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9functoolz_identity(__pyx_v_x, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.functoolz.identity", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":34 * * * def apply(*func_and_args, **kwargs): # <<<<<<<<<<<<<< * """ * Applies a function and returns the results */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_3apply(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_2apply[] = "apply(*func_and_args, **kwargs)\n\n Applies a function and returns the results\n\n >>> def double(x): return 2*x\n >>> def inc(x): return x + 1\n >>> apply(double, 5)\n 10\n\n >>> tuple(map(apply, [double, inc, double], [10, 500, 8000]))\n (20, 501, 16000)\n "; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_3apply = {"apply", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9functoolz_3apply, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9functoolz_2apply}; static PyObject *__pyx_pw_7cytoolz_9functoolz_3apply(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_func_and_args = 0; PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("apply (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "apply", 1))) return NULL; if (unlikely(__pyx_kwds)) { __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); } else { __pyx_v_kwargs = NULL; } __Pyx_INCREF(__pyx_args); __pyx_v_func_and_args = __pyx_args; __pyx_r = __pyx_pf_7cytoolz_9functoolz_2apply(__pyx_self, __pyx_v_func_and_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_func_and_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_2apply(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func_and_args, PyObject *__pyx_v_kwargs) { 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; __Pyx_RefNannySetupContext("apply", 0); /* "cytoolz/functoolz.pyx":46 * (20, 501, 16000) * """ * if not func_and_args: # <<<<<<<<<<<<<< * raise TypeError('func argument is required') * return func_and_args[0](*func_and_args[1:], **kwargs) */ __pyx_t_1 = (PyTuple_GET_SIZE(__pyx_v_func_and_args) != 0); __pyx_t_2 = ((!__pyx_t_1) != 0); if (unlikely(__pyx_t_2)) { /* "cytoolz/functoolz.pyx":47 * """ * if not func_and_args: * raise TypeError('func argument is required') # <<<<<<<<<<<<<< * return func_and_args[0](*func_and_args[1:], **kwargs) * */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __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_ERR(0, 47, __pyx_L1_error) /* "cytoolz/functoolz.pyx":46 * (20, 501, 16000) * """ * if not func_and_args: # <<<<<<<<<<<<<< * raise TypeError('func argument is required') * return func_and_args[0](*func_and_args[1:], **kwargs) */ } /* "cytoolz/functoolz.pyx":48 * if not func_and_args: * raise TypeError('func argument is required') * return func_and_args[0](*func_and_args[1:], **kwargs) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_func_and_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyTuple_GetSlice(__pyx_v_func_and_args, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 48, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, __pyx_v_kwargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 48, __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_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":34 * * * def apply(*func_and_args, **kwargs): # <<<<<<<<<<<<<< * """ * Applies a function and returns the results */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("cytoolz.functoolz.apply", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":51 * * * cdef object c_thread_first(object val, object forms): # <<<<<<<<<<<<<< * cdef object form, func * cdef tuple args */ static PyObject *__pyx_f_7cytoolz_9functoolz_c_thread_first(PyObject *__pyx_v_val, PyObject *__pyx_v_forms) { PyObject *__pyx_v_form = 0; PyObject *__pyx_v_func = 0; PyObject *__pyx_v_args = 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; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("c_thread_first", 0); __Pyx_INCREF(__pyx_v_val); /* "cytoolz/functoolz.pyx":54 * cdef object form, func * cdef tuple args * for form in forms: # <<<<<<<<<<<<<< * if PyCallable_Check(form): * val = form(val) */ if (likely(PyList_CheckExact(__pyx_v_forms)) || PyTuple_CheckExact(__pyx_v_forms)) { __pyx_t_1 = __pyx_v_forms; __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_forms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 54, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 54, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 54, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_form, __pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/functoolz.pyx":55 * cdef tuple args * for form in forms: * if PyCallable_Check(form): # <<<<<<<<<<<<<< * val = form(val) * elif PyTuple_Check(form): */ __pyx_t_5 = (PyCallable_Check(__pyx_v_form) != 0); if (__pyx_t_5) { /* "cytoolz/functoolz.pyx":56 * for form in forms: * if PyCallable_Check(form): * val = form(val) # <<<<<<<<<<<<<< * elif PyTuple_Check(form): * func, args = form[0], (val,) + form[1:] */ __Pyx_INCREF(__pyx_v_form); __pyx_t_6 = __pyx_v_form; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_val) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_val); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/functoolz.pyx":55 * cdef tuple args * for form in forms: * if PyCallable_Check(form): # <<<<<<<<<<<<<< * val = form(val) * elif PyTuple_Check(form): */ goto __pyx_L5; } /* "cytoolz/functoolz.pyx":57 * if PyCallable_Check(form): * val = form(val) * elif PyTuple_Check(form): # <<<<<<<<<<<<<< * func, args = form[0], (val,) + form[1:] * val = PyObject_CallObject(func, args) */ __pyx_t_5 = (PyTuple_Check(__pyx_v_form) != 0); if (__pyx_t_5) { /* "cytoolz/functoolz.pyx":58 * val = form(val) * elif PyTuple_Check(form): * func, args = form[0], (val,) + form[1:] # <<<<<<<<<<<<<< * val = PyObject_CallObject(func, args) * else: */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_form, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_val); __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_v_form, 1, 0, NULL, NULL, &__pyx_slice__2, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 58, __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_ERR(0, 58, __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 (!(likely(PyTuple_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_8)->tp_name), 0))) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; /* "cytoolz/functoolz.pyx":59 * elif PyTuple_Check(form): * func, args = form[0], (val,) + form[1:] * val = PyObject_CallObject(func, args) # <<<<<<<<<<<<<< * else: * val = None */ __pyx_t_8 = PyObject_CallObject(__pyx_v_func, __pyx_v_args); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 59, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_8); __pyx_t_8 = 0; /* "cytoolz/functoolz.pyx":57 * if PyCallable_Check(form): * val = form(val) * elif PyTuple_Check(form): # <<<<<<<<<<<<<< * func, args = form[0], (val,) + form[1:] * val = PyObject_CallObject(func, args) */ goto __pyx_L5; } /* "cytoolz/functoolz.pyx":61 * val = PyObject_CallObject(func, args) * else: * val = None # <<<<<<<<<<<<<< * return val * */ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_val, Py_None); } __pyx_L5:; /* "cytoolz/functoolz.pyx":54 * cdef object form, func * cdef tuple args * for form in forms: # <<<<<<<<<<<<<< * if PyCallable_Check(form): * val = form(val) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":62 * else: * val = None * return val # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_val); __pyx_r = __pyx_v_val; goto __pyx_L0; /* "cytoolz/functoolz.pyx":51 * * * cdef object c_thread_first(object val, object forms): # <<<<<<<<<<<<<< * cdef object form, func * cdef tuple args */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("cytoolz.functoolz.c_thread_first", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_form); __Pyx_XDECREF(__pyx_v_func); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":65 * * * def thread_first(val, *forms): # <<<<<<<<<<<<<< * """ * Thread value through a sequence of functions/forms */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_5thread_first(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_4thread_first[] = "thread_first(val, *forms)\n\n Thread value through a sequence of functions/forms\n\n >>> def double(x): return 2*x\n >>> def inc(x): return x + 1\n >>> thread_first(1, inc, double)\n 4\n\n If the function expects more than one input you can specify those inputs\n in a tuple. The value is used as the first input.\n\n >>> def add(x, y): return x + y\n >>> def pow(x, y): return x**y\n >>> thread_first(1, (add, 4), (pow, 2)) # pow(add(1, 4), 2)\n 25\n\n So in general\n thread_first(x, f, (g, y, z))\n expands to\n g(f(x), y, z)\n\n See Also:\n thread_last\n "; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_5thread_first = {"thread_first", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9functoolz_5thread_first, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9functoolz_4thread_first}; static PyObject *__pyx_pw_7cytoolz_9functoolz_5thread_first(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_val = 0; PyObject *__pyx_v_forms = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("thread_first (wrapper)", 0); if (PyTuple_GET_SIZE(__pyx_args) > 1) { __pyx_v_forms = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); if (unlikely(!__pyx_v_forms)) { __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_forms); } else { __pyx_v_forms = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } { 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) { default: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "thread_first") < 0)) __PYX_ERR(0, 65, __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("thread_first", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 65, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_forms); __pyx_v_forms = 0; __Pyx_AddTraceback("cytoolz.functoolz.thread_first", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9functoolz_4thread_first(__pyx_self, __pyx_v_val, __pyx_v_forms); /* function exit code */ __Pyx_XDECREF(__pyx_v_forms); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_4thread_first(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val, PyObject *__pyx_v_forms) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("thread_first", 0); /* "cytoolz/functoolz.pyx":90 * thread_last * """ * return c_thread_first(val, forms) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9functoolz_c_thread_first(__pyx_v_val, __pyx_v_forms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":65 * * * def thread_first(val, *forms): # <<<<<<<<<<<<<< * """ * Thread value through a sequence of functions/forms */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.functoolz.thread_first", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":93 * * * cdef object c_thread_last(object val, object forms): # <<<<<<<<<<<<<< * cdef object form, func * cdef tuple args */ static PyObject *__pyx_f_7cytoolz_9functoolz_c_thread_last(PyObject *__pyx_v_val, PyObject *__pyx_v_forms) { PyObject *__pyx_v_form = 0; PyObject *__pyx_v_func = 0; PyObject *__pyx_v_args = 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; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("c_thread_last", 0); __Pyx_INCREF(__pyx_v_val); /* "cytoolz/functoolz.pyx":96 * cdef object form, func * cdef tuple args * for form in forms: # <<<<<<<<<<<<<< * if PyCallable_Check(form): * val = form(val) */ if (likely(PyList_CheckExact(__pyx_v_forms)) || PyTuple_CheckExact(__pyx_v_forms)) { __pyx_t_1 = __pyx_v_forms; __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_forms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 96, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 96, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 96, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 96, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_form, __pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/functoolz.pyx":97 * cdef tuple args * for form in forms: * if PyCallable_Check(form): # <<<<<<<<<<<<<< * val = form(val) * elif PyTuple_Check(form): */ __pyx_t_5 = (PyCallable_Check(__pyx_v_form) != 0); if (__pyx_t_5) { /* "cytoolz/functoolz.pyx":98 * for form in forms: * if PyCallable_Check(form): * val = form(val) # <<<<<<<<<<<<<< * elif PyTuple_Check(form): * func, args = form[0], form[1:] + (val,) */ __Pyx_INCREF(__pyx_v_form); __pyx_t_6 = __pyx_v_form; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_val) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_val); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 98, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/functoolz.pyx":97 * cdef tuple args * for form in forms: * if PyCallable_Check(form): # <<<<<<<<<<<<<< * val = form(val) * elif PyTuple_Check(form): */ goto __pyx_L5; } /* "cytoolz/functoolz.pyx":99 * if PyCallable_Check(form): * val = form(val) * elif PyTuple_Check(form): # <<<<<<<<<<<<<< * func, args = form[0], form[1:] + (val,) * val = PyObject_CallObject(func, args) */ __pyx_t_5 = (PyTuple_Check(__pyx_v_form) != 0); if (__pyx_t_5) { /* "cytoolz/functoolz.pyx":100 * val = form(val) * elif PyTuple_Check(form): * func, args = form[0], form[1:] + (val,) # <<<<<<<<<<<<<< * val = PyObject_CallObject(func, args) * else: */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_form, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_form, 1, 0, NULL, NULL, &__pyx_slice__2, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_val); __pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 100, __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 (!(likely(PyTuple_CheckExact(__pyx_t_8))||((__pyx_t_8) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_8)->tp_name), 0))) __PYX_ERR(0, 100, __pyx_L1_error) __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_args, ((PyObject*)__pyx_t_8)); __pyx_t_8 = 0; /* "cytoolz/functoolz.pyx":101 * elif PyTuple_Check(form): * func, args = form[0], form[1:] + (val,) * val = PyObject_CallObject(func, args) # <<<<<<<<<<<<<< * else: * val = None */ __pyx_t_8 = PyObject_CallObject(__pyx_v_func, __pyx_v_args); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 101, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_8); __pyx_t_8 = 0; /* "cytoolz/functoolz.pyx":99 * if PyCallable_Check(form): * val = form(val) * elif PyTuple_Check(form): # <<<<<<<<<<<<<< * func, args = form[0], form[1:] + (val,) * val = PyObject_CallObject(func, args) */ goto __pyx_L5; } /* "cytoolz/functoolz.pyx":103 * val = PyObject_CallObject(func, args) * else: * val = None # <<<<<<<<<<<<<< * return val * */ /*else*/ { __Pyx_INCREF(Py_None); __Pyx_DECREF_SET(__pyx_v_val, Py_None); } __pyx_L5:; /* "cytoolz/functoolz.pyx":96 * cdef object form, func * cdef tuple args * for form in forms: # <<<<<<<<<<<<<< * if PyCallable_Check(form): * val = form(val) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":104 * else: * val = None * return val # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_val); __pyx_r = __pyx_v_val; goto __pyx_L0; /* "cytoolz/functoolz.pyx":93 * * * cdef object c_thread_last(object val, object forms): # <<<<<<<<<<<<<< * cdef object form, func * cdef tuple args */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("cytoolz.functoolz.c_thread_last", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_form); __Pyx_XDECREF(__pyx_v_func); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":107 * * * def thread_last(val, *forms): # <<<<<<<<<<<<<< * """ * Thread value through a sequence of functions/forms */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7thread_last(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_6thread_last[] = "thread_last(val, *forms)\n\n Thread value through a sequence of functions/forms\n\n >>> def double(x): return 2*x\n >>> def inc(x): return x + 1\n >>> thread_last(1, inc, double)\n 4\n\n If the function expects more than one input you can specify those inputs\n in a tuple. The value is used as the last input.\n\n >>> def add(x, y): return x + y\n >>> def pow(x, y): return x**y\n >>> thread_last(1, (add, 4), (pow, 2)) # pow(2, add(4, 1))\n 32\n\n So in general\n thread_last(x, f, (g, y, z))\n expands to\n g(y, z, f(x))\n\n >>> def iseven(x):\n ... return x % 2 == 0\n >>> list(thread_last([1, 2, 3], (map, inc), (filter, iseven)))\n [2, 4]\n\n See Also:\n thread_first\n "; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_7thread_last = {"thread_last", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9functoolz_7thread_last, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9functoolz_6thread_last}; static PyObject *__pyx_pw_7cytoolz_9functoolz_7thread_last(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_val = 0; PyObject *__pyx_v_forms = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("thread_last (wrapper)", 0); if (PyTuple_GET_SIZE(__pyx_args) > 1) { __pyx_v_forms = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); if (unlikely(!__pyx_v_forms)) { __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_forms); } else { __pyx_v_forms = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } { 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) { default: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_val)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "thread_last") < 0)) __PYX_ERR(0, 107, __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("thread_last", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 107, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_forms); __pyx_v_forms = 0; __Pyx_AddTraceback("cytoolz.functoolz.thread_last", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9functoolz_6thread_last(__pyx_self, __pyx_v_val, __pyx_v_forms); /* function exit code */ __Pyx_XDECREF(__pyx_v_forms); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_6thread_last(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_val, PyObject *__pyx_v_forms) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("thread_last", 0); /* "cytoolz/functoolz.pyx":137 * thread_first * """ * return c_thread_last(val, forms) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9functoolz_c_thread_last(__pyx_v_val, __pyx_v_forms); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":107 * * * def thread_last(val, *forms): # <<<<<<<<<<<<<< * """ * Thread value through a sequence of functions/forms */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.functoolz.thread_last", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":152 * * * cdef object _empty_kwargs(): # <<<<<<<<<<<<<< * if ( _partial).kw is None: * return None */ static PyObject *__pyx_f_7cytoolz_9functoolz__empty_kwargs(void) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("_empty_kwargs", 0); /* "cytoolz/functoolz.pyx":153 * * cdef object _empty_kwargs(): * if ( _partial).kw is None: # <<<<<<<<<<<<<< * return None * return PyDict_New() */ __pyx_t_1 = (((PyObject *)((struct __pyx_t_7cytoolz_9functoolz_partialobject *)__pyx_v_7cytoolz_9functoolz__partial)->kw) == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":154 * cdef object _empty_kwargs(): * if ( _partial).kw is None: * return None # <<<<<<<<<<<<<< * return PyDict_New() * */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "cytoolz/functoolz.pyx":153 * * cdef object _empty_kwargs(): * if ( _partial).kw is None: # <<<<<<<<<<<<<< * return None * return PyDict_New() */ } /* "cytoolz/functoolz.pyx":155 * if ( _partial).kw is None: * return None * return PyDict_New() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":152 * * * cdef object _empty_kwargs(): # <<<<<<<<<<<<<< * if ( _partial).kw is None: * return None */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.functoolz._empty_kwargs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":189 * """ * * def __cinit__(self, *args, **kwargs): # <<<<<<<<<<<<<< * if not args: * raise TypeError('__init__() takes at least 2 arguments (1 given)') */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_5curry_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_5curry_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry___cinit__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_5curry___cinit__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_func = NULL; int __pyx_r; __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; __Pyx_RefNannySetupContext("__cinit__", 0); __Pyx_INCREF(__pyx_v_args); /* "cytoolz/functoolz.pyx":190 * * def __cinit__(self, *args, **kwargs): * if not args: # <<<<<<<<<<<<<< * raise TypeError('__init__() takes at least 2 arguments (1 given)') * func, args = args[0], args[1:] */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_args); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 190, __pyx_L1_error) __pyx_t_2 = ((!__pyx_t_1) != 0); if (unlikely(__pyx_t_2)) { /* "cytoolz/functoolz.pyx":191 * def __cinit__(self, *args, **kwargs): * if not args: * raise TypeError('__init__() takes at least 2 arguments (1 given)') # <<<<<<<<<<<<<< * func, args = args[0], args[1:] * if not PyCallable_Check(func): */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __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_ERR(0, 191, __pyx_L1_error) /* "cytoolz/functoolz.pyx":190 * * def __cinit__(self, *args, **kwargs): * if not args: # <<<<<<<<<<<<<< * raise TypeError('__init__() takes at least 2 arguments (1 given)') * func, args = args[0], args[1:] */ } /* "cytoolz/functoolz.pyx":192 * if not args: * raise TypeError('__init__() takes at least 2 arguments (1 given)') * func, args = args[0], args[1:] # <<<<<<<<<<<<<< * if not PyCallable_Check(func): * raise TypeError("Input must be callable") */ __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyTuple_GetSlice(__pyx_v_args, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_func = __pyx_t_3; __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/functoolz.pyx":193 * raise TypeError('__init__() takes at least 2 arguments (1 given)') * func, args = args[0], args[1:] * if not PyCallable_Check(func): # <<<<<<<<<<<<<< * raise TypeError("Input must be callable") * */ __pyx_t_2 = ((!(PyCallable_Check(__pyx_v_func) != 0)) != 0); if (unlikely(__pyx_t_2)) { /* "cytoolz/functoolz.pyx":194 * func, args = args[0], args[1:] * if not PyCallable_Check(func): * raise TypeError("Input must be callable") # <<<<<<<<<<<<<< * * # curry- or functools.partial-like object? Unpack and merge arguments */ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __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_ERR(0, 194, __pyx_L1_error) /* "cytoolz/functoolz.pyx":193 * raise TypeError('__init__() takes at least 2 arguments (1 given)') * func, args = args[0], args[1:] * if not PyCallable_Check(func): # <<<<<<<<<<<<<< * raise TypeError("Input must be callable") * */ } /* "cytoolz/functoolz.pyx":197 * * # curry- or functools.partial-like object? Unpack and merge arguments * if (hasattr(func, 'func') # <<<<<<<<<<<<<< * and hasattr(func, 'args') * and hasattr(func, 'keywords') */ __pyx_t_1 = __Pyx_HasAttr(__pyx_v_func, __pyx_n_s_func); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 197, __pyx_L1_error) __pyx_t_5 = (__pyx_t_1 != 0); if (__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L6_bool_binop_done; } /* "cytoolz/functoolz.pyx":198 * # curry- or functools.partial-like object? Unpack and merge arguments * if (hasattr(func, 'func') * and hasattr(func, 'args') # <<<<<<<<<<<<<< * and hasattr(func, 'keywords') * and isinstance(func.args, tuple)): */ __pyx_t_5 = __Pyx_HasAttr(__pyx_v_func, __pyx_n_s_args); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 198, __pyx_L1_error) __pyx_t_1 = (__pyx_t_5 != 0); if (__pyx_t_1) { } else { __pyx_t_2 = __pyx_t_1; goto __pyx_L6_bool_binop_done; } /* "cytoolz/functoolz.pyx":199 * if (hasattr(func, 'func') * and hasattr(func, 'args') * and hasattr(func, 'keywords') # <<<<<<<<<<<<<< * and isinstance(func.args, tuple)): * if func.keywords: */ __pyx_t_1 = __Pyx_HasAttr(__pyx_v_func, __pyx_n_s_keywords); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 199, __pyx_L1_error) __pyx_t_5 = (__pyx_t_1 != 0); if (__pyx_t_5) { } else { __pyx_t_2 = __pyx_t_5; goto __pyx_L6_bool_binop_done; } /* "cytoolz/functoolz.pyx":200 * and hasattr(func, 'args') * and hasattr(func, 'keywords') * and isinstance(func.args, tuple)): # <<<<<<<<<<<<<< * if func.keywords: * PyDict_Merge(kwargs, func.keywords, False) */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyTuple_Check(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = (__pyx_t_5 != 0); __pyx_t_2 = __pyx_t_1; __pyx_L6_bool_binop_done:; /* "cytoolz/functoolz.pyx":197 * * # curry- or functools.partial-like object? Unpack and merge arguments * if (hasattr(func, 'func') # <<<<<<<<<<<<<< * and hasattr(func, 'args') * and hasattr(func, 'keywords') */ if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":201 * and hasattr(func, 'keywords') * and isinstance(func.args, tuple)): * if func.keywords: # <<<<<<<<<<<<<< * PyDict_Merge(kwargs, func.keywords, False) * ## Equivalent to: */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_keywords); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":202 * and isinstance(func.args, tuple)): * if func.keywords: * PyDict_Merge(kwargs, func.keywords, False) # <<<<<<<<<<<<<< * ## Equivalent to: * # for key, val in func.keywords.items(): */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_keywords); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = PyDict_Merge(__pyx_v_kwargs, __pyx_t_4, 0); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/functoolz.pyx":201 * and hasattr(func, 'keywords') * and isinstance(func.args, tuple)): * if func.keywords: # <<<<<<<<<<<<<< * PyDict_Merge(kwargs, func.keywords, False) * ## Equivalent to: */ } /* "cytoolz/functoolz.pyx":207 * # if key not in kwargs: * # kwargs[key] = val * args = func.args + args # <<<<<<<<<<<<<< * func = func.func * */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":208 * # kwargs[key] = val * args = func.args + args * func = func.func # <<<<<<<<<<<<<< * * self.func = func */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_func, __pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":197 * * # curry- or functools.partial-like object? Unpack and merge arguments * if (hasattr(func, 'func') # <<<<<<<<<<<<<< * and hasattr(func, 'args') * and hasattr(func, 'keywords') */ } /* "cytoolz/functoolz.pyx":210 * func = func.func * * self.func = func # <<<<<<<<<<<<<< * self.args = args * self.keywords = kwargs if kwargs else _empty_kwargs() */ __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; /* "cytoolz/functoolz.pyx":211 * * self.func = func * self.args = args # <<<<<<<<<<<<<< * self.keywords = kwargs if kwargs else _empty_kwargs() * self.__doc__ = getattr(func, '__doc__', None) */ if (!(likely(PyTuple_CheckExact(__pyx_v_args))||((__pyx_v_args) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_args)->tp_name), 0))) __PYX_ERR(0, 211, __pyx_L1_error) __pyx_t_3 = __pyx_v_args; __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->args); __Pyx_DECREF(__pyx_v_self->args); __pyx_v_self->args = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":212 * self.func = func * self.args = args * self.keywords = kwargs if kwargs else _empty_kwargs() # <<<<<<<<<<<<<< * self.__doc__ = getattr(func, '__doc__', None) * self.__name__ = getattr(func, '__name__', '') */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 212, __pyx_L1_error) if (__pyx_t_2) { __Pyx_INCREF(__pyx_v_kwargs); __pyx_t_3 = __pyx_v_kwargs; } else { __pyx_t_4 = __pyx_f_7cytoolz_9functoolz__empty_kwargs(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (!(likely(PyDict_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 212, __pyx_L1_error) __pyx_t_3 = __pyx_t_4; __pyx_t_4 = 0; } __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->keywords); __Pyx_DECREF(__pyx_v_self->keywords); __pyx_v_self->keywords = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":213 * self.args = args * self.keywords = kwargs if kwargs else _empty_kwargs() * self.__doc__ = getattr(func, '__doc__', None) # <<<<<<<<<<<<<< * self.__name__ = getattr(func, '__name__', '') * self.__module__ = getattr(func, '__module__', None) */ __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_func, __pyx_n_s_doc, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->__doc__); __Pyx_DECREF(__pyx_v_self->__doc__); __pyx_v_self->__doc__ = __pyx_t_3; __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":214 * self.keywords = kwargs if kwargs else _empty_kwargs() * self.__doc__ = getattr(func, '__doc__', None) * self.__name__ = getattr(func, '__name__', '') # <<<<<<<<<<<<<< * self.__module__ = getattr(func, '__module__', None) * self.__qualname__ = getattr(func, '__qualname__', None) */ __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_func, __pyx_n_s_name, __pyx_kp_s_curry); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __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; /* "cytoolz/functoolz.pyx":215 * self.__doc__ = getattr(func, '__doc__', None) * self.__name__ = getattr(func, '__name__', '') * self.__module__ = getattr(func, '__module__', None) # <<<<<<<<<<<<<< * self.__qualname__ = getattr(func, '__qualname__', None) * self._sigspec = None */ __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_func, __pyx_n_s_module, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->__module__); __Pyx_DECREF(__pyx_v_self->__module__); __pyx_v_self->__module__ = __pyx_t_3; __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":216 * self.__name__ = getattr(func, '__name__', '') * self.__module__ = getattr(func, '__module__', None) * self.__qualname__ = getattr(func, '__qualname__', None) # <<<<<<<<<<<<<< * self._sigspec = None * self._has_unknown_args = None */ __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_func, __pyx_n_s_qualname, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->__qualname__); __Pyx_DECREF(__pyx_v_self->__qualname__); __pyx_v_self->__qualname__ = __pyx_t_3; __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":217 * self.__module__ = getattr(func, '__module__', None) * self.__qualname__ = getattr(func, '__qualname__', None) * self._sigspec = None # <<<<<<<<<<<<<< * self._has_unknown_args = None * */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_sigspec); __Pyx_DECREF(__pyx_v_self->_sigspec); __pyx_v_self->_sigspec = Py_None; /* "cytoolz/functoolz.pyx":218 * self.__qualname__ = getattr(func, '__qualname__', None) * self._sigspec = None * self._has_unknown_args = None # <<<<<<<<<<<<<< * * def __str__(self): */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->_has_unknown_args); __Pyx_DECREF(__pyx_v_self->_has_unknown_args); __pyx_v_self->_has_unknown_args = Py_None; /* "cytoolz/functoolz.pyx":189 * """ * * def __cinit__(self, *args, **kwargs): # <<<<<<<<<<<<<< * if not args: * raise TypeError('__init__() takes at least 2 arguments (1 given)') */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("cytoolz.functoolz.curry.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_func); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":220 * self._has_unknown_args = None * * def __str__(self): # <<<<<<<<<<<<<< * return str(self.func) * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_3__str__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_3__str__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_2__str__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_2__str__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__str__", 0); /* "cytoolz/functoolz.pyx":221 * * def __str__(self): * return str(self.func) # <<<<<<<<<<<<<< * * def __repr__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_self->func); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":220 * self._has_unknown_args = None * * def __str__(self): # <<<<<<<<<<<<<< * return str(self.func) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.functoolz.curry.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":223 * return str(self.func) * * def __repr__(self): # <<<<<<<<<<<<<< * return repr(self.func) * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_5__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_5__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_4__repr__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_4__repr__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); /* "cytoolz/functoolz.pyx":224 * * def __repr__(self): * return repr(self.func) # <<<<<<<<<<<<<< * * def __hash__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_v_self->func; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyObject_Repr(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __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; /* "cytoolz/functoolz.pyx":223 * return str(self.func) * * def __repr__(self): # <<<<<<<<<<<<<< * return repr(self.func) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.functoolz.curry.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":226 * return repr(self.func) * * def __hash__(self): # <<<<<<<<<<<<<< * return hash((self.func, self.args, * frozenset(self.keywords.items()) if self.keywords */ /* Python wrapper */ static Py_hash_t __pyx_pw_7cytoolz_9functoolz_5curry_7__hash__(PyObject *__pyx_v_self); /*proto*/ static Py_hash_t __pyx_pw_7cytoolz_9functoolz_5curry_7__hash__(PyObject *__pyx_v_self) { Py_hash_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_6__hash__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_hash_t __pyx_pf_7cytoolz_9functoolz_5curry_6__hash__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self) { Py_hash_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; Py_hash_t __pyx_t_5; __Pyx_RefNannySetupContext("__hash__", 0); /* "cytoolz/functoolz.pyx":228 * def __hash__(self): * return hash((self.func, self.args, * frozenset(self.keywords.items()) if self.keywords # <<<<<<<<<<<<<< * else None)) * */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->keywords); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 228, __pyx_L1_error) if (__pyx_t_2) { if (unlikely(__pyx_v_self->keywords == Py_None)) { PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items"); __PYX_ERR(0, 228, __pyx_L1_error) } __pyx_t_3 = __Pyx_PyDict_Items(__pyx_v_self->keywords); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyFrozenSet_New(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_4; __pyx_t_4 = 0; } else { /* "cytoolz/functoolz.pyx":229 * return hash((self.func, self.args, * frozenset(self.keywords.items()) if self.keywords * else None)) # <<<<<<<<<<<<<< * * def __richcmp__(self, other, int op): */ __Pyx_INCREF(Py_None); __pyx_t_1 = Py_None; } /* "cytoolz/functoolz.pyx":227 * * def __hash__(self): * return hash((self.func, self.args, # <<<<<<<<<<<<<< * frozenset(self.keywords.items()) if self.keywords * else None)) */ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_self->func); __Pyx_GIVEREF(__pyx_v_self->func); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->func); __Pyx_INCREF(__pyx_v_self->args); __Pyx_GIVEREF(__pyx_v_self->args); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->args); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_5 = PyObject_Hash(__pyx_t_4); if (unlikely(__pyx_t_5 == ((Py_hash_t)-1))) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_5; goto __pyx_L0; /* "cytoolz/functoolz.pyx":226 * return repr(self.func) * * def __hash__(self): # <<<<<<<<<<<<<< * return hash((self.func, self.args, * frozenset(self.keywords.items()) if self.keywords */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("cytoolz.functoolz.curry.__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; } /* "cytoolz/functoolz.pyx":231 * else None)) * * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<< * is_equal = (isinstance(other, curry) and self.func == other.func and * self.args == other.args and self.keywords == other.keywords) */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_9__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_9__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_8__richcmp__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self), ((PyObject *)__pyx_v_other), ((int)__pyx_v_op)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_8__richcmp__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) { PyObject *__pyx_v_is_equal = 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; __Pyx_RefNannySetupContext("__richcmp__", 0); /* "cytoolz/functoolz.pyx":232 * * def __richcmp__(self, other, int op): * is_equal = (isinstance(other, curry) and self.func == other.func and # <<<<<<<<<<<<<< * self.args == other.args and self.keywords == other.keywords) * if op == Py_EQ: */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_7cytoolz_9functoolz_curry); if (__pyx_t_2) { } else { __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_v_self->func, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __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_ERR(0, 232, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L3_bool_binop_done; } /* "cytoolz/functoolz.pyx":233 * def __richcmp__(self, other, int op): * is_equal = (isinstance(other, curry) and self.func == other.func and * self.args == other.args and self.keywords == other.keywords) # <<<<<<<<<<<<<< * if op == Py_EQ: * return is_equal */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_v_self->args, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __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_ERR(0, 233, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L3_bool_binop_done; } __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_keywords); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_v_self->keywords, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_L3_bool_binop_done:; __pyx_v_is_equal = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":234 * is_equal = (isinstance(other, curry) and self.func == other.func and * self.args == other.args and self.keywords == other.keywords) * if op == Py_EQ: # <<<<<<<<<<<<<< * return is_equal * if op == Py_NE: */ __pyx_t_2 = ((__pyx_v_op == Py_EQ) != 0); if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":235 * self.args == other.args and self.keywords == other.keywords) * if op == Py_EQ: * return is_equal # <<<<<<<<<<<<<< * if op == Py_NE: * return not is_equal */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_is_equal); __pyx_r = __pyx_v_is_equal; goto __pyx_L0; /* "cytoolz/functoolz.pyx":234 * is_equal = (isinstance(other, curry) and self.func == other.func and * self.args == other.args and self.keywords == other.keywords) * if op == Py_EQ: # <<<<<<<<<<<<<< * return is_equal * if op == Py_NE: */ } /* "cytoolz/functoolz.pyx":236 * if op == Py_EQ: * return is_equal * if op == Py_NE: # <<<<<<<<<<<<<< * return not is_equal * return PyObject_RichCompare(id(self), id(other), op) */ __pyx_t_2 = ((__pyx_v_op == Py_NE) != 0); if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":237 * return is_equal * if op == Py_NE: * return not is_equal # <<<<<<<<<<<<<< * return PyObject_RichCompare(id(self), id(other), op) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_is_equal); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 237, __pyx_L1_error) __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":236 * if op == Py_EQ: * return is_equal * if op == Py_NE: # <<<<<<<<<<<<<< * return not is_equal * return PyObject_RichCompare(id(self), id(other), op) */ } /* "cytoolz/functoolz.pyx":238 * if op == Py_NE: * return not is_equal * return PyObject_RichCompare(id(self), id(other), op) # <<<<<<<<<<<<<< * * def __call__(self, *args, **kwargs): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, __pyx_v_other); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, __pyx_v_op); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __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_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":231 * else None)) * * def __richcmp__(self, other, int op): # <<<<<<<<<<<<<< * is_equal = (isinstance(other, curry) and self.func == other.func and * self.args == other.args and self.keywords == other.keywords) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("cytoolz.functoolz.curry.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_is_equal); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":240 * return PyObject_RichCompare(id(self), id(other), op) * * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< * cdef object val * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_11__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_11__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 1))) return NULL; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_10__call__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_10__call__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_val = 0; 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; 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; __Pyx_RefNannySetupContext("__call__", 0); __Pyx_INCREF(__pyx_v_args); /* "cytoolz/functoolz.pyx":243 * cdef object val * * if PyTuple_GET_SIZE(args) == 0: # <<<<<<<<<<<<<< * args = self.args * elif PyTuple_GET_SIZE(self.args) != 0: */ __pyx_t_1 = ((PyTuple_GET_SIZE(__pyx_v_args) == 0) != 0); if (__pyx_t_1) { /* "cytoolz/functoolz.pyx":244 * * if PyTuple_GET_SIZE(args) == 0: * args = self.args # <<<<<<<<<<<<<< * elif PyTuple_GET_SIZE(self.args) != 0: * args = PySequence_Concat(self.args, args) */ __pyx_t_2 = __pyx_v_self->args; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/functoolz.pyx":243 * cdef object val * * if PyTuple_GET_SIZE(args) == 0: # <<<<<<<<<<<<<< * args = self.args * elif PyTuple_GET_SIZE(self.args) != 0: */ goto __pyx_L3; } /* "cytoolz/functoolz.pyx":245 * if PyTuple_GET_SIZE(args) == 0: * args = self.args * elif PyTuple_GET_SIZE(self.args) != 0: # <<<<<<<<<<<<<< * args = PySequence_Concat(self.args, args) * if self.keywords is not None: */ __pyx_t_2 = __pyx_v_self->args; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = ((PyTuple_GET_SIZE(__pyx_t_2) != 0) != 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "cytoolz/functoolz.pyx":246 * args = self.args * elif PyTuple_GET_SIZE(self.args) != 0: * args = PySequence_Concat(self.args, args) # <<<<<<<<<<<<<< * if self.keywords is not None: * PyDict_Merge(kwargs, self.keywords, False) */ __pyx_t_2 = __pyx_v_self->args; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = PySequence_Concat(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":245 * if PyTuple_GET_SIZE(args) == 0: * args = self.args * elif PyTuple_GET_SIZE(self.args) != 0: # <<<<<<<<<<<<<< * args = PySequence_Concat(self.args, args) * if self.keywords is not None: */ } __pyx_L3:; /* "cytoolz/functoolz.pyx":247 * elif PyTuple_GET_SIZE(self.args) != 0: * args = PySequence_Concat(self.args, args) * if self.keywords is not None: # <<<<<<<<<<<<<< * PyDict_Merge(kwargs, self.keywords, False) * try: */ __pyx_t_1 = (__pyx_v_self->keywords != ((PyObject*)Py_None)); __pyx_t_4 = (__pyx_t_1 != 0); if (__pyx_t_4) { /* "cytoolz/functoolz.pyx":248 * args = PySequence_Concat(self.args, args) * if self.keywords is not None: * PyDict_Merge(kwargs, self.keywords, False) # <<<<<<<<<<<<<< * try: * return self.func(*args, **kwargs) */ __pyx_t_3 = __pyx_v_self->keywords; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = PyDict_Merge(__pyx_v_kwargs, __pyx_t_3, 0); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":247 * elif PyTuple_GET_SIZE(self.args) != 0: * args = PySequence_Concat(self.args, args) * if self.keywords is not None: # <<<<<<<<<<<<<< * PyDict_Merge(kwargs, self.keywords, False) * try: */ } /* "cytoolz/functoolz.pyx":249 * if self.keywords is not None: * PyDict_Merge(kwargs, self.keywords, False) * try: # <<<<<<<<<<<<<< * return self.func(*args, **kwargs) * except TypeError as val: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __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:*/ { /* "cytoolz/functoolz.pyx":250 * PyDict_Merge(kwargs, self.keywords, False) * try: * return self.func(*args, **kwargs) # <<<<<<<<<<<<<< * except TypeError as val: * if self._should_curry_internal(args, kwargs, val): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_self->func, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L5_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_L9_try_return; /* "cytoolz/functoolz.pyx":249 * if self.keywords is not None: * PyDict_Merge(kwargs, self.keywords, False) * try: # <<<<<<<<<<<<<< * return self.func(*args, **kwargs) * except TypeError as val: */ } __pyx_L5_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":251 * try: * return self.func(*args, **kwargs) * except TypeError as val: # <<<<<<<<<<<<<< * if self._should_curry_internal(args, kwargs, val): * return type(self)(self.func, *args, **kwargs) */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_5) { __Pyx_AddTraceback("cytoolz.functoolz.curry.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_9) < 0) __PYX_ERR(0, 251, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_v_val = __pyx_t_3; /* "cytoolz/functoolz.pyx":252 * return self.func(*args, **kwargs) * except TypeError as val: * if self._should_curry_internal(args, kwargs, val): # <<<<<<<<<<<<<< * return type(self)(self.func, *args, **kwargs) * raise */ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_should_curry_internal); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 252, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_11, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[4] = {__pyx_t_12, __pyx_v_args, __pyx_v_kwargs, __pyx_v_val}; __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 252, __pyx_L7_except_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) { PyObject *__pyx_temp[4] = {__pyx_t_12, __pyx_v_args, __pyx_v_kwargs, __pyx_v_val}; __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 252, __pyx_L7_except_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_10); } else #endif { __pyx_t_13 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 252, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_13); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL; } __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_5, __pyx_v_args); __Pyx_INCREF(__pyx_v_kwargs); __Pyx_GIVEREF(__pyx_v_kwargs); PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_5, __pyx_v_kwargs); __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_5, __pyx_v_val); __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_13, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 252, __pyx_L7_except_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_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 252, __pyx_L7_except_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; if (__pyx_t_4) { /* "cytoolz/functoolz.pyx":253 * except TypeError as val: * if self._should_curry_internal(args, kwargs, val): * return type(self)(self.func, *args, **kwargs) # <<<<<<<<<<<<<< * raise * */ __Pyx_XDECREF(__pyx_r); __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 253, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_self->func); __Pyx_GIVEREF(__pyx_v_self->func); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_self->func); __pyx_t_11 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 253, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_13 = PyNumber_Add(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 253, __pyx_L7_except_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_t_11 = __Pyx_PyObject_Call(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_t_13, __pyx_v_kwargs); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 253, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __pyx_r = __pyx_t_11; __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L8_except_return; /* "cytoolz/functoolz.pyx":252 * return self.func(*args, **kwargs) * except TypeError as val: * if self._should_curry_internal(args, kwargs, val): # <<<<<<<<<<<<<< * return type(self)(self.func, *args, **kwargs) * raise */ } /* "cytoolz/functoolz.pyx":254 * if self._should_curry_internal(args, kwargs, val): * return type(self)(self.func, *args, **kwargs) * raise # <<<<<<<<<<<<<< * * def _should_curry(self, args, kwargs, exc=None): */ __Pyx_GIVEREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_9); __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_9); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_9 = 0; __PYX_ERR(0, 254, __pyx_L7_except_error) } goto __pyx_L7_except_error; __pyx_L7_except_error:; /* "cytoolz/functoolz.pyx":249 * if self.keywords is not None: * PyDict_Merge(kwargs, self.keywords, False) * try: # <<<<<<<<<<<<<< * return self.func(*args, **kwargs) * except TypeError as val: */ __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_L9_try_return:; __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_L0; __pyx_L8_except_return:; __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_L0; } /* "cytoolz/functoolz.pyx":240 * return PyObject_RichCompare(id(self), id(other), op) * * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< * cdef object val * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __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_AddTraceback("cytoolz.functoolz.curry.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":256 * raise * * def _should_curry(self, args, kwargs, exc=None): # <<<<<<<<<<<<<< * if PyTuple_GET_SIZE(args) == 0: * args = self.args */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_13_should_curry(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_5curry_12_should_curry[] = "curry._should_curry(self, args, kwargs, exc=None)"; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_5curry_13_should_curry = {"_should_curry", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9functoolz_5curry_13_should_curry, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9functoolz_5curry_12_should_curry}; static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_13_should_curry(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; CYTHON_UNUSED PyObject *__pyx_v_exc = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_should_curry (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_exc,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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_should_curry", 0, 2, 3, 1); __PYX_ERR(0, 256, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_should_curry") < 0)) __PYX_ERR(0, 256, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; 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_args = values[0]; __pyx_v_kwargs = values[1]; __pyx_v_exc = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_should_curry", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 256, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.functoolz.curry._should_curry", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_12_should_curry(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs, __pyx_v_exc); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_12_should_curry(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_exc) { 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; __Pyx_RefNannySetupContext("_should_curry", 0); __Pyx_INCREF(__pyx_v_args); /* "cytoolz/functoolz.pyx":257 * * def _should_curry(self, args, kwargs, exc=None): * if PyTuple_GET_SIZE(args) == 0: # <<<<<<<<<<<<<< * args = self.args * elif PyTuple_GET_SIZE(self.args) != 0: */ __pyx_t_1 = ((PyTuple_GET_SIZE(__pyx_v_args) == 0) != 0); if (__pyx_t_1) { /* "cytoolz/functoolz.pyx":258 * def _should_curry(self, args, kwargs, exc=None): * if PyTuple_GET_SIZE(args) == 0: * args = self.args # <<<<<<<<<<<<<< * elif PyTuple_GET_SIZE(self.args) != 0: * args = PySequence_Concat(self.args, args) */ __pyx_t_2 = __pyx_v_self->args; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/functoolz.pyx":257 * * def _should_curry(self, args, kwargs, exc=None): * if PyTuple_GET_SIZE(args) == 0: # <<<<<<<<<<<<<< * args = self.args * elif PyTuple_GET_SIZE(self.args) != 0: */ goto __pyx_L3; } /* "cytoolz/functoolz.pyx":259 * if PyTuple_GET_SIZE(args) == 0: * args = self.args * elif PyTuple_GET_SIZE(self.args) != 0: # <<<<<<<<<<<<<< * args = PySequence_Concat(self.args, args) * if self.keywords is not None: */ __pyx_t_2 = __pyx_v_self->args; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = ((PyTuple_GET_SIZE(__pyx_t_2) != 0) != 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "cytoolz/functoolz.pyx":260 * args = self.args * elif PyTuple_GET_SIZE(self.args) != 0: * args = PySequence_Concat(self.args, args) # <<<<<<<<<<<<<< * if self.keywords is not None: * PyDict_Merge(kwargs, self.keywords, False) */ __pyx_t_2 = __pyx_v_self->args; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = PySequence_Concat(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":259 * if PyTuple_GET_SIZE(args) == 0: * args = self.args * elif PyTuple_GET_SIZE(self.args) != 0: # <<<<<<<<<<<<<< * args = PySequence_Concat(self.args, args) * if self.keywords is not None: */ } __pyx_L3:; /* "cytoolz/functoolz.pyx":261 * elif PyTuple_GET_SIZE(self.args) != 0: * args = PySequence_Concat(self.args, args) * if self.keywords is not None: # <<<<<<<<<<<<<< * PyDict_Merge(kwargs, self.keywords, False) * return self._should_curry_internal(args, kwargs) */ __pyx_t_1 = (__pyx_v_self->keywords != ((PyObject*)Py_None)); __pyx_t_4 = (__pyx_t_1 != 0); if (__pyx_t_4) { /* "cytoolz/functoolz.pyx":262 * args = PySequence_Concat(self.args, args) * if self.keywords is not None: * PyDict_Merge(kwargs, self.keywords, False) # <<<<<<<<<<<<<< * return self._should_curry_internal(args, kwargs) * */ __pyx_t_3 = __pyx_v_self->keywords; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = PyDict_Merge(__pyx_v_kwargs, __pyx_t_3, 0); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 262, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":261 * elif PyTuple_GET_SIZE(self.args) != 0: * args = PySequence_Concat(self.args, args) * if self.keywords is not None: # <<<<<<<<<<<<<< * PyDict_Merge(kwargs, self.keywords, False) * return self._should_curry_internal(args, kwargs) */ } /* "cytoolz/functoolz.pyx":263 * if self.keywords is not None: * PyDict_Merge(kwargs, self.keywords, False) * return self._should_curry_internal(args, kwargs) # <<<<<<<<<<<<<< * * def _should_curry_internal(self, args, kwargs, exc=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_should_curry_internal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_args, __pyx_v_kwargs}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_args, __pyx_v_kwargs}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_5, __pyx_v_args); __Pyx_INCREF(__pyx_v_kwargs); __Pyx_GIVEREF(__pyx_v_kwargs); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_5, __pyx_v_kwargs); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":256 * raise * * def _should_curry(self, args, kwargs, exc=None): # <<<<<<<<<<<<<< * if PyTuple_GET_SIZE(args) == 0: * args = self.args */ /* 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("cytoolz.functoolz.curry._should_curry", __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; } /* "cytoolz/functoolz.pyx":265 * return self._should_curry_internal(args, kwargs) * * def _should_curry_internal(self, args, kwargs, exc=None): # <<<<<<<<<<<<<< * func = self.func * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_15_should_curry_internal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_5curry_14_should_curry_internal[] = "curry._should_curry_internal(self, args, kwargs, exc=None)"; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_5curry_15_should_curry_internal = {"_should_curry_internal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9functoolz_5curry_15_should_curry_internal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9functoolz_5curry_14_should_curry_internal}; static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_15_should_curry_internal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; CYTHON_UNUSED PyObject *__pyx_v_exc = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_should_curry_internal (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_exc,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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_should_curry_internal", 0, 2, 3, 1); __PYX_ERR(0, 265, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_should_curry_internal") < 0)) __PYX_ERR(0, 265, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; 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_args = values[0]; __pyx_v_kwargs = values[1]; __pyx_v_exc = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_should_curry_internal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 265, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.functoolz.curry._should_curry_internal", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_14_should_curry_internal(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs, __pyx_v_exc); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_14_should_curry_internal(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_exc) { PyObject *__pyx_v_func = NULL; PyObject *__pyx_v_sigspec = 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; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("_should_curry_internal", 0); /* "cytoolz/functoolz.pyx":266 * * def _should_curry_internal(self, args, kwargs, exc=None): * func = self.func # <<<<<<<<<<<<<< * * # `toolz` has these three lines */ __pyx_t_1 = __pyx_v_self->func; __Pyx_INCREF(__pyx_t_1); __pyx_v_func = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":273 * # kwargs = dict(self.keywords, **kwargs) * * if self._sigspec is None: # <<<<<<<<<<<<<< * sigspec = self._sigspec = _sigs.signature_or_spec(func) * self._has_unknown_args = has_varargs(func, sigspec) is not False */ __pyx_t_2 = (__pyx_v_self->_sigspec == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "cytoolz/functoolz.pyx":274 * * if self._sigspec is None: * sigspec = self._sigspec = _sigs.signature_or_spec(func) # <<<<<<<<<<<<<< * self._has_unknown_args = has_varargs(func, sigspec) is not False * else: */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sigs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_signature_or_spec); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_func) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_func); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_1); __pyx_v_sigspec = __pyx_t_1; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_sigspec); __Pyx_DECREF(__pyx_v_self->_sigspec); __pyx_v_self->_sigspec = __pyx_t_1; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":275 * if self._sigspec is None: * sigspec = self._sigspec = _sigs.signature_or_spec(func) * self._has_unknown_args = has_varargs(func, sigspec) is not False # <<<<<<<<<<<<<< * else: * sigspec = self._sigspec */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_has_varargs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_func, __pyx_v_sigspec}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_func, __pyx_v_sigspec}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_func); __Pyx_INCREF(__pyx_v_sigspec); __Pyx_GIVEREF(__pyx_v_sigspec); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_sigspec); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __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_t_3 = (__pyx_t_1 != Py_False); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->_has_unknown_args); __Pyx_DECREF(__pyx_v_self->_has_unknown_args); __pyx_v_self->_has_unknown_args = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":273 * # kwargs = dict(self.keywords, **kwargs) * * if self._sigspec is None: # <<<<<<<<<<<<<< * sigspec = self._sigspec = _sigs.signature_or_spec(func) * self._has_unknown_args = has_varargs(func, sigspec) is not False */ goto __pyx_L3; } /* "cytoolz/functoolz.pyx":277 * self._has_unknown_args = has_varargs(func, sigspec) is not False * else: * sigspec = self._sigspec # <<<<<<<<<<<<<< * * if is_partial_args(func, args, kwargs, sigspec) is False: */ /*else*/ { __pyx_t_1 = __pyx_v_self->_sigspec; __Pyx_INCREF(__pyx_t_1); __pyx_v_sigspec = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L3:; /* "cytoolz/functoolz.pyx":279 * sigspec = self._sigspec * * if is_partial_args(func, args, kwargs, sigspec) is False: # <<<<<<<<<<<<<< * # Nothing can make the call valid * return False */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_partial_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_v_func, __pyx_v_args, __pyx_v_kwargs, __pyx_v_sigspec}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[5] = {__pyx_t_7, __pyx_v_func, __pyx_v_args, __pyx_v_kwargs, __pyx_v_sigspec}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_4 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_v_func); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_v_args); __Pyx_INCREF(__pyx_v_kwargs); __Pyx_GIVEREF(__pyx_v_kwargs); PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_6, __pyx_v_kwargs); __Pyx_INCREF(__pyx_v_sigspec); __Pyx_GIVEREF(__pyx_v_sigspec); PyTuple_SET_ITEM(__pyx_t_4, 3+__pyx_t_6, __pyx_v_sigspec); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __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_t_3 = (__pyx_t_1 == Py_False); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":281 * if is_partial_args(func, args, kwargs, sigspec) is False: * # Nothing can make the call valid * return False # <<<<<<<<<<<<<< * elif self._has_unknown_args: * # The call may be valid and raised a TypeError, but we curry */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "cytoolz/functoolz.pyx":279 * sigspec = self._sigspec * * if is_partial_args(func, args, kwargs, sigspec) is False: # <<<<<<<<<<<<<< * # Nothing can make the call valid * return False */ } /* "cytoolz/functoolz.pyx":282 * # Nothing can make the call valid * return False * elif self._has_unknown_args: # <<<<<<<<<<<<<< * # The call may be valid and raised a TypeError, but we curry * # anyway because the function may have `*args`. This is useful */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_has_unknown_args); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 282, __pyx_L1_error) if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":286 * # anyway because the function may have `*args`. This is useful * # for decorators with signature `func(*args, **kwargs)`. * return True # <<<<<<<<<<<<<< * elif not is_valid_args(func, args, kwargs, sigspec): * # Adding more arguments may make the call valid */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "cytoolz/functoolz.pyx":282 * # Nothing can make the call valid * return False * elif self._has_unknown_args: # <<<<<<<<<<<<<< * # The call may be valid and raised a TypeError, but we curry * # anyway because the function may have `*args`. This is useful */ } /* "cytoolz/functoolz.pyx":287 * # for decorators with signature `func(*args, **kwargs)`. * return True * elif not is_valid_args(func, args, kwargs, sigspec): # <<<<<<<<<<<<<< * # Adding more arguments may make the call valid * return True */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_is_valid_args); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_func, __pyx_v_args, __pyx_v_kwargs, __pyx_v_sigspec}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_func, __pyx_v_args, __pyx_v_kwargs, __pyx_v_sigspec}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_7 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_func); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_args); __Pyx_INCREF(__pyx_v_kwargs); __Pyx_GIVEREF(__pyx_v_kwargs); PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_kwargs); __Pyx_INCREF(__pyx_v_sigspec); __Pyx_GIVEREF(__pyx_v_sigspec); PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_sigspec); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __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_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = ((!__pyx_t_2) != 0); if (__pyx_t_3) { /* "cytoolz/functoolz.pyx":289 * elif not is_valid_args(func, args, kwargs, sigspec): * # Adding more arguments may make the call valid * return True # <<<<<<<<<<<<<< * else: * # There was a genuine TypeError */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "cytoolz/functoolz.pyx":287 * # for decorators with signature `func(*args, **kwargs)`. * return True * elif not is_valid_args(func, args, kwargs, sigspec): # <<<<<<<<<<<<<< * # Adding more arguments may make the call valid * return True */ } /* "cytoolz/functoolz.pyx":292 * else: * # There was a genuine TypeError * return False # <<<<<<<<<<<<<< * * def bind(self, *args, **kwargs): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; } /* "cytoolz/functoolz.pyx":265 * return self._should_curry_internal(args, kwargs) * * def _should_curry_internal(self, args, kwargs, exc=None): # <<<<<<<<<<<<<< * func = self.func * */ /* 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); __Pyx_AddTraceback("cytoolz.functoolz.curry._should_curry_internal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_func); __Pyx_XDECREF(__pyx_v_sigspec); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":294 * return False * * def bind(self, *args, **kwargs): # <<<<<<<<<<<<<< * return type(self)(self, *args, **kwargs) * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_17bind(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_5curry_16bind[] = "curry.bind(self, *args, **kwargs)"; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_5curry_17bind = {"bind", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9functoolz_5curry_17bind, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9functoolz_5curry_16bind}; static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_17bind(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("bind (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "bind", 1))) return NULL; if (unlikely(__pyx_kwds)) { __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); } else { __pyx_v_kwargs = NULL; } __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_16bind(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_16bind(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("bind", 0); /* "cytoolz/functoolz.pyx":295 * * def bind(self, *args, **kwargs): * return type(self)(self, *args, **kwargs) # <<<<<<<<<<<<<< * * def call(self, *args, **kwargs): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)); __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_t_2, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __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; /* "cytoolz/functoolz.pyx":294 * return False * * def bind(self, *args, **kwargs): # <<<<<<<<<<<<<< * return type(self)(self, *args, **kwargs) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.functoolz.curry.bind", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":297 * return type(self)(self, *args, **kwargs) * * def call(self, *args, **kwargs): # <<<<<<<<<<<<<< * cdef object val * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_19call(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_5curry_18call[] = "curry.call(self, *args, **kwargs)"; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_5curry_19call = {"call", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9functoolz_5curry_19call, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9functoolz_5curry_18call}; static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_19call(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("call (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "call", 1))) return NULL; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_18call(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_18call(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { 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; __Pyx_RefNannySetupContext("call", 0); __Pyx_INCREF(__pyx_v_args); /* "cytoolz/functoolz.pyx":300 * cdef object val * * if PyTuple_GET_SIZE(args) == 0: # <<<<<<<<<<<<<< * args = self.args * elif PyTuple_GET_SIZE(self.args) != 0: */ __pyx_t_1 = ((PyTuple_GET_SIZE(__pyx_v_args) == 0) != 0); if (__pyx_t_1) { /* "cytoolz/functoolz.pyx":301 * * if PyTuple_GET_SIZE(args) == 0: * args = self.args # <<<<<<<<<<<<<< * elif PyTuple_GET_SIZE(self.args) != 0: * args = PySequence_Concat(self.args, args) */ __pyx_t_2 = __pyx_v_self->args; __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/functoolz.pyx":300 * cdef object val * * if PyTuple_GET_SIZE(args) == 0: # <<<<<<<<<<<<<< * args = self.args * elif PyTuple_GET_SIZE(self.args) != 0: */ goto __pyx_L3; } /* "cytoolz/functoolz.pyx":302 * if PyTuple_GET_SIZE(args) == 0: * args = self.args * elif PyTuple_GET_SIZE(self.args) != 0: # <<<<<<<<<<<<<< * args = PySequence_Concat(self.args, args) * if self.keywords is not None: */ __pyx_t_2 = __pyx_v_self->args; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = ((PyTuple_GET_SIZE(__pyx_t_2) != 0) != 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "cytoolz/functoolz.pyx":303 * args = self.args * elif PyTuple_GET_SIZE(self.args) != 0: * args = PySequence_Concat(self.args, args) # <<<<<<<<<<<<<< * if self.keywords is not None: * PyDict_Merge(kwargs, self.keywords, False) */ __pyx_t_2 = __pyx_v_self->args; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = PySequence_Concat(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_args, __pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":302 * if PyTuple_GET_SIZE(args) == 0: * args = self.args * elif PyTuple_GET_SIZE(self.args) != 0: # <<<<<<<<<<<<<< * args = PySequence_Concat(self.args, args) * if self.keywords is not None: */ } __pyx_L3:; /* "cytoolz/functoolz.pyx":304 * elif PyTuple_GET_SIZE(self.args) != 0: * args = PySequence_Concat(self.args, args) * if self.keywords is not None: # <<<<<<<<<<<<<< * PyDict_Merge(kwargs, self.keywords, False) * return self.func(*args, **kwargs) */ __pyx_t_1 = (__pyx_v_self->keywords != ((PyObject*)Py_None)); __pyx_t_4 = (__pyx_t_1 != 0); if (__pyx_t_4) { /* "cytoolz/functoolz.pyx":305 * args = PySequence_Concat(self.args, args) * if self.keywords is not None: * PyDict_Merge(kwargs, self.keywords, False) # <<<<<<<<<<<<<< * return self.func(*args, **kwargs) * */ __pyx_t_3 = __pyx_v_self->keywords; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = PyDict_Merge(__pyx_v_kwargs, __pyx_t_3, 0); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":304 * elif PyTuple_GET_SIZE(self.args) != 0: * args = PySequence_Concat(self.args, args) * if self.keywords is not None: # <<<<<<<<<<<<<< * PyDict_Merge(kwargs, self.keywords, False) * return self.func(*args, **kwargs) */ } /* "cytoolz/functoolz.pyx":306 * if self.keywords is not None: * PyDict_Merge(kwargs, self.keywords, False) * return self.func(*args, **kwargs) # <<<<<<<<<<<<<< * * def __get__(self, instance, owner): */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_self->func, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __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; /* "cytoolz/functoolz.pyx":297 * return type(self)(self, *args, **kwargs) * * def call(self, *args, **kwargs): # <<<<<<<<<<<<<< * cdef object val * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.functoolz.curry.call", __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; } /* "cytoolz/functoolz.pyx":308 * return self.func(*args, **kwargs) * * def __get__(self, instance, owner): # <<<<<<<<<<<<<< * if instance is None: * return self */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_21__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_instance, PyObject *__pyx_v_owner); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_21__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_instance, PyObject *__pyx_v_owner) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_20__get__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self), ((PyObject *)__pyx_v_instance), ((PyObject *)__pyx_v_owner)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_20__get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self, PyObject *__pyx_v_instance, CYTHON_UNUSED PyObject *__pyx_v_owner) { 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_t_6; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("__get__", 0); /* "cytoolz/functoolz.pyx":309 * * def __get__(self, instance, owner): * if instance is None: # <<<<<<<<<<<<<< * return self * return type(self)(self, instance) */ __pyx_t_1 = (__pyx_v_instance == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":310 * def __get__(self, instance, owner): * if instance is None: * return self # <<<<<<<<<<<<<< * return type(self)(self, instance) * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "cytoolz/functoolz.pyx":309 * * def __get__(self, instance, owner): * if instance is None: # <<<<<<<<<<<<<< * return self * return type(self)(self, instance) */ } /* "cytoolz/functoolz.pyx":311 * if instance is None: * return self * return type(self)(self, instance) # <<<<<<<<<<<<<< * * property __signature__: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __pyx_t_4 = ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_instance}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_instance}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(__pyx_v_instance); __Pyx_GIVEREF(__pyx_v_instance); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_instance); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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; /* "cytoolz/functoolz.pyx":308 * return self.func(*args, **kwargs) * * def __get__(self, instance, owner): # <<<<<<<<<<<<<< * if instance is None: * 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_7); __Pyx_AddTraceback("cytoolz.functoolz.curry.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":314 * * property __signature__: * def __get__(self): # <<<<<<<<<<<<<< * sig = inspect.signature(self.func) * args = self.args or () */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_13__signature___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_13__signature___1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_13__signature_____get__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_13__signature_____get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self) { PyObject *__pyx_v_sig = NULL; PyObject *__pyx_v_args = NULL; PyObject *__pyx_v_keywords = NULL; PyObject *__pyx_v_params = NULL; PyObject *__pyx_v_skip = NULL; PyObject *__pyx_v_param = NULL; int __pyx_v_kwonly; PyObject *__pyx_v_newparams = NULL; PyObject *__pyx_v_kind = NULL; PyObject *__pyx_v_default = 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_t_7; Py_ssize_t __pyx_t_8; Py_ssize_t __pyx_t_9; int __pyx_t_10; __Pyx_RefNannySetupContext("__get__", 0); /* "cytoolz/functoolz.pyx":315 * property __signature__: * def __get__(self): * sig = inspect.signature(self.func) # <<<<<<<<<<<<<< * args = self.args or () * keywords = self.keywords or {} */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_inspect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signature); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_self->func) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->func); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_sig = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":316 * def __get__(self): * sig = inspect.signature(self.func) * args = self.args or () # <<<<<<<<<<<<<< * keywords = self.keywords or {} * if is_partial_args(self.func, args, keywords, sig) is False: */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->args); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 316, __pyx_L1_error) if (!__pyx_t_4) { } else { __Pyx_INCREF(__pyx_v_self->args); __pyx_t_1 = __pyx_v_self->args; goto __pyx_L3_bool_binop_done; } __Pyx_INCREF(__pyx_empty_tuple); __pyx_t_1 = __pyx_empty_tuple; __pyx_L3_bool_binop_done:; __pyx_v_args = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":317 * sig = inspect.signature(self.func) * args = self.args or () * keywords = self.keywords or {} # <<<<<<<<<<<<<< * if is_partial_args(self.func, args, keywords, sig) is False: * raise TypeError('curry object has incorrect arguments') */ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->keywords); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 317, __pyx_L1_error) if (!__pyx_t_4) { } else { __Pyx_INCREF(__pyx_v_self->keywords); __pyx_t_1 = __pyx_v_self->keywords; goto __pyx_L5_bool_binop_done; } __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_L5_bool_binop_done:; __pyx_v_keywords = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":318 * args = self.args or () * keywords = self.keywords or {} * if is_partial_args(self.func, args, keywords, sig) is False: # <<<<<<<<<<<<<< * raise TypeError('curry object has incorrect arguments') * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_is_partial_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[5] = {__pyx_t_2, __pyx_v_self->func, __pyx_v_args, __pyx_v_keywords, __pyx_v_sig}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[5] = {__pyx_t_2, __pyx_v_self->func, __pyx_v_args, __pyx_v_keywords, __pyx_v_sig}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL; } __Pyx_INCREF(__pyx_v_self->func); __Pyx_GIVEREF(__pyx_v_self->func); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_self->func); __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args); __Pyx_INCREF(__pyx_v_keywords); __Pyx_GIVEREF(__pyx_v_keywords); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_keywords); __Pyx_INCREF(__pyx_v_sig); __Pyx_GIVEREF(__pyx_v_sig); PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_sig); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_4 = (__pyx_t_1 == Py_False); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (__pyx_t_4 != 0); if (unlikely(__pyx_t_7)) { /* "cytoolz/functoolz.pyx":319 * keywords = self.keywords or {} * if is_partial_args(self.func, args, keywords, sig) is False: * raise TypeError('curry object has incorrect arguments') # <<<<<<<<<<<<<< * * params = list(sig.parameters.values()) */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __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_ERR(0, 319, __pyx_L1_error) /* "cytoolz/functoolz.pyx":318 * args = self.args or () * keywords = self.keywords or {} * if is_partial_args(self.func, args, keywords, sig) is False: # <<<<<<<<<<<<<< * raise TypeError('curry object has incorrect arguments') * */ } /* "cytoolz/functoolz.pyx":321 * raise TypeError('curry object has incorrect arguments') * * params = list(sig.parameters.values()) # <<<<<<<<<<<<<< * skip = 0 * for param in params[:len(args)]: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_parameters); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_values); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_params = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; /* "cytoolz/functoolz.pyx":322 * * params = list(sig.parameters.values()) * skip = 0 # <<<<<<<<<<<<<< * for param in params[:len(args)]: * if param.kind == param.VAR_POSITIONAL: */ __Pyx_INCREF(__pyx_int_0); __pyx_v_skip = __pyx_int_0; /* "cytoolz/functoolz.pyx":323 * params = list(sig.parameters.values()) * skip = 0 * for param in params[:len(args)]: # <<<<<<<<<<<<<< * if param.kind == param.VAR_POSITIONAL: * break */ if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(0, 323, __pyx_L1_error) } __pyx_t_8 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 323, __pyx_L1_error) __pyx_t_6 = __Pyx_PyList_GetSlice(__pyx_v_params, 0, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = __pyx_t_6; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; for (;;) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 323, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_XDECREF_SET(__pyx_v_param, __pyx_t_6); __pyx_t_6 = 0; /* "cytoolz/functoolz.pyx":324 * skip = 0 * for param in params[:len(args)]: * if param.kind == param.VAR_POSITIONAL: # <<<<<<<<<<<<<< * break * skip += 1 */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_param, __pyx_n_s_kind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_param, __pyx_n_s_VAR_POSITIONAL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_7) { /* "cytoolz/functoolz.pyx":325 * for param in params[:len(args)]: * if param.kind == param.VAR_POSITIONAL: * break # <<<<<<<<<<<<<< * skip += 1 * */ goto __pyx_L9_break; /* "cytoolz/functoolz.pyx":324 * skip = 0 * for param in params[:len(args)]: * if param.kind == param.VAR_POSITIONAL: # <<<<<<<<<<<<<< * break * skip += 1 */ } /* "cytoolz/functoolz.pyx":326 * if param.kind == param.VAR_POSITIONAL: * break * skip += 1 # <<<<<<<<<<<<<< * * kwonly = False */ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_skip, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_skip, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/functoolz.pyx":323 * params = list(sig.parameters.values()) * skip = 0 * for param in params[:len(args)]: # <<<<<<<<<<<<<< * if param.kind == param.VAR_POSITIONAL: * break */ } __pyx_L9_break:; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":328 * skip += 1 * * kwonly = False # <<<<<<<<<<<<<< * newparams = [] * for param in params[skip:]: */ __pyx_v_kwonly = 0; /* "cytoolz/functoolz.pyx":329 * * kwonly = False * newparams = [] # <<<<<<<<<<<<<< * for param in params[skip:]: * kind = param.kind */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_newparams = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":330 * kwonly = False * newparams = [] * for param in params[skip:]: # <<<<<<<<<<<<<< * kind = param.kind * default = param.default */ __Pyx_INCREF(__pyx_v_skip); __pyx_t_1 = __pyx_v_skip; __pyx_t_7 = (__pyx_t_1 == Py_None); if (__pyx_t_7) { __pyx_t_8 = 0; } else { __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 330, __pyx_L1_error) __pyx_t_8 = __pyx_t_9; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyList_GetSlice(__pyx_v_params, __pyx_t_8, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 330, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_param, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":331 * newparams = [] * for param in params[skip:]: * kind = param.kind # <<<<<<<<<<<<<< * default = param.default * if kind == param.VAR_KEYWORD: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_param, __pyx_n_s_kind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_kind, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":332 * for param in params[skip:]: * kind = param.kind * default = param.default # <<<<<<<<<<<<<< * if kind == param.VAR_KEYWORD: * pass */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_param, __pyx_n_s_default); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_default, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":333 * kind = param.kind * default = param.default * if kind == param.VAR_KEYWORD: # <<<<<<<<<<<<<< * pass * elif kind == param.VAR_POSITIONAL: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_param, __pyx_n_s_VAR_KEYWORD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_RichCompare(__pyx_v_kind, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error) __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_ERR(0, 333, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_7) { goto __pyx_L13; } /* "cytoolz/functoolz.pyx":335 * if kind == param.VAR_KEYWORD: * pass * elif kind == param.VAR_POSITIONAL: # <<<<<<<<<<<<<< * if kwonly: * continue */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_param, __pyx_n_s_VAR_POSITIONAL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = PyObject_RichCompare(__pyx_v_kind, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 335, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_7) { /* "cytoolz/functoolz.pyx":336 * pass * elif kind == param.VAR_POSITIONAL: * if kwonly: # <<<<<<<<<<<<<< * continue * elif param.name in keywords: */ __pyx_t_7 = (__pyx_v_kwonly != 0); if (__pyx_t_7) { /* "cytoolz/functoolz.pyx":337 * elif kind == param.VAR_POSITIONAL: * if kwonly: * continue # <<<<<<<<<<<<<< * elif param.name in keywords: * default = keywords[param.name] */ goto __pyx_L11_continue; /* "cytoolz/functoolz.pyx":336 * pass * elif kind == param.VAR_POSITIONAL: * if kwonly: # <<<<<<<<<<<<<< * continue * elif param.name in keywords: */ } /* "cytoolz/functoolz.pyx":335 * if kind == param.VAR_KEYWORD: * pass * elif kind == param.VAR_POSITIONAL: # <<<<<<<<<<<<<< * if kwonly: * continue */ goto __pyx_L13; } /* "cytoolz/functoolz.pyx":338 * if kwonly: * continue * elif param.name in keywords: # <<<<<<<<<<<<<< * default = keywords[param.name] * kind = param.KEYWORD_ONLY */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_param, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (unlikely(__pyx_v_keywords == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 338, __pyx_L1_error) } __pyx_t_7 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_keywords, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = (__pyx_t_7 != 0); if (__pyx_t_4) { /* "cytoolz/functoolz.pyx":339 * continue * elif param.name in keywords: * default = keywords[param.name] # <<<<<<<<<<<<<< * kind = param.KEYWORD_ONLY * kwonly = True */ if (unlikely(__pyx_v_keywords == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 339, __pyx_L1_error) } __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_param, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_keywords, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_default, __pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":340 * elif param.name in keywords: * default = keywords[param.name] * kind = param.KEYWORD_ONLY # <<<<<<<<<<<<<< * kwonly = True * else: */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_param, __pyx_n_s_KEYWORD_ONLY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kind, __pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":341 * default = keywords[param.name] * kind = param.KEYWORD_ONLY * kwonly = True # <<<<<<<<<<<<<< * else: * if kwonly: */ __pyx_v_kwonly = 1; /* "cytoolz/functoolz.pyx":338 * if kwonly: * continue * elif param.name in keywords: # <<<<<<<<<<<<<< * default = keywords[param.name] * kind = param.KEYWORD_ONLY */ goto __pyx_L13; } /* "cytoolz/functoolz.pyx":343 * kwonly = True * else: * if kwonly: # <<<<<<<<<<<<<< * kind = param.KEYWORD_ONLY * if default is param.empty: */ /*else*/ { __pyx_t_4 = (__pyx_v_kwonly != 0); if (__pyx_t_4) { /* "cytoolz/functoolz.pyx":344 * else: * if kwonly: * kind = param.KEYWORD_ONLY # <<<<<<<<<<<<<< * if default is param.empty: * default = no_default */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_param, __pyx_n_s_KEYWORD_ONLY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_kind, __pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":343 * kwonly = True * else: * if kwonly: # <<<<<<<<<<<<<< * kind = param.KEYWORD_ONLY * if default is param.empty: */ } /* "cytoolz/functoolz.pyx":345 * if kwonly: * kind = param.KEYWORD_ONLY * if default is param.empty: # <<<<<<<<<<<<<< * default = no_default * newparams.append(param.replace(default=default, kind=kind)) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_param, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = (__pyx_v_default == __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = (__pyx_t_4 != 0); if (__pyx_t_7) { /* "cytoolz/functoolz.pyx":346 * kind = param.KEYWORD_ONLY * if default is param.empty: * default = no_default # <<<<<<<<<<<<<< * newparams.append(param.replace(default=default, kind=kind)) * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_no_default); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 346, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_default, __pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":345 * if kwonly: * kind = param.KEYWORD_ONLY * if default is param.empty: # <<<<<<<<<<<<<< * default = no_default * newparams.append(param.replace(default=default, kind=kind)) */ } } __pyx_L13:; /* "cytoolz/functoolz.pyx":347 * if default is param.empty: * default = no_default * newparams.append(param.replace(default=default, kind=kind)) # <<<<<<<<<<<<<< * * return sig.replace(parameters=newparams) */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_param, __pyx_n_s_replace); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_default, __pyx_v_default) < 0) __PYX_ERR(0, 347, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_kind, __pyx_v_kind) < 0) __PYX_ERR(0, 347, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 347, __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_t_10 = __Pyx_PyList_Append(__pyx_v_newparams, __pyx_t_6); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "cytoolz/functoolz.pyx":330 * kwonly = False * newparams = [] * for param in params[skip:]: # <<<<<<<<<<<<<< * kind = param.kind * default = param.default */ __pyx_L11_continue:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/functoolz.pyx":349 * newparams.append(param.replace(default=default, kind=kind)) * * return sig.replace(parameters=newparams) # <<<<<<<<<<<<<< * * def __reduce__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_parameters, __pyx_v_newparams) < 0) __PYX_ERR(0, 349, __pyx_L1_error) __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __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_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":314 * * property __signature__: * def __get__(self): # <<<<<<<<<<<<<< * sig = inspect.signature(self.func) * args = self.args or () */ /* 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("cytoolz.functoolz.curry.__signature__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_sig); __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_keywords); __Pyx_XDECREF(__pyx_v_params); __Pyx_XDECREF(__pyx_v_skip); __Pyx_XDECREF(__pyx_v_param); __Pyx_XDECREF(__pyx_v_newparams); __Pyx_XDECREF(__pyx_v_kind); __Pyx_XDECREF(__pyx_v_default); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":351 * return sig.replace(parameters=newparams) * * def __reduce__(self): # <<<<<<<<<<<<<< * func = self.func * modname = getattr(func, '__module__', None) */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_23__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_5curry_22__reduce__[] = "curry.__reduce__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_5curry_23__reduce__ = {"__reduce__", (PyCFunction)__pyx_pw_7cytoolz_9functoolz_5curry_23__reduce__, METH_NOARGS, __pyx_doc_7cytoolz_9functoolz_5curry_22__reduce__}; static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_23__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_22__reduce__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_22__reduce__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self) { PyObject *__pyx_v_func = NULL; PyObject *__pyx_v_modname = NULL; PyObject *__pyx_v_qualname = NULL; PyObject *__pyx_v_is_decorated = NULL; PyObject *__pyx_v_attrs = NULL; PyObject *__pyx_v_obj = NULL; PyObject *__pyx_v_attr = NULL; PyObject *__pyx_v_state = 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; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); int __pyx_t_8; int __pyx_t_9; __Pyx_RefNannySetupContext("__reduce__", 0); /* "cytoolz/functoolz.pyx":352 * * def __reduce__(self): * func = self.func # <<<<<<<<<<<<<< * modname = getattr(func, '__module__', None) * qualname = getattr(func, '__qualname__', None) */ __pyx_t_1 = __pyx_v_self->func; __Pyx_INCREF(__pyx_t_1); __pyx_v_func = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":353 * def __reduce__(self): * func = self.func * modname = getattr(func, '__module__', None) # <<<<<<<<<<<<<< * qualname = getattr(func, '__qualname__', None) * if qualname is None: */ __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_func, __pyx_n_s_module, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_modname = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":354 * func = self.func * modname = getattr(func, '__module__', None) * qualname = getattr(func, '__qualname__', None) # <<<<<<<<<<<<<< * if qualname is None: * qualname = getattr(func, '__name__', None) */ __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_func, __pyx_n_s_qualname, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_qualname = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":355 * modname = getattr(func, '__module__', None) * qualname = getattr(func, '__qualname__', None) * if qualname is None: # <<<<<<<<<<<<<< * qualname = getattr(func, '__name__', None) * is_decorated = None */ __pyx_t_2 = (__pyx_v_qualname == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "cytoolz/functoolz.pyx":356 * qualname = getattr(func, '__qualname__', None) * if qualname is None: * qualname = getattr(func, '__name__', None) # <<<<<<<<<<<<<< * is_decorated = None * if modname and qualname: */ __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_func, __pyx_n_s_name, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_qualname, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":355 * modname = getattr(func, '__module__', None) * qualname = getattr(func, '__qualname__', None) * if qualname is None: # <<<<<<<<<<<<<< * qualname = getattr(func, '__name__', None) * is_decorated = None */ } /* "cytoolz/functoolz.pyx":357 * if qualname is None: * qualname = getattr(func, '__name__', None) * is_decorated = None # <<<<<<<<<<<<<< * if modname and qualname: * attrs = [] */ __Pyx_INCREF(Py_None); __pyx_v_is_decorated = Py_None; /* "cytoolz/functoolz.pyx":358 * qualname = getattr(func, '__name__', None) * is_decorated = None * if modname and qualname: # <<<<<<<<<<<<<< * attrs = [] * obj = import_module(modname) */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_modname); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 358, __pyx_L1_error) if (__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L5_bool_binop_done; } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_qualname); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 358, __pyx_L1_error) __pyx_t_3 = __pyx_t_2; __pyx_L5_bool_binop_done:; if (__pyx_t_3) { /* "cytoolz/functoolz.pyx":359 * is_decorated = None * if modname and qualname: * attrs = [] # <<<<<<<<<<<<<< * obj = import_module(modname) * for attr in qualname.split('.'): */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_attrs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":360 * if modname and qualname: * attrs = [] * obj = import_module(modname) # <<<<<<<<<<<<<< * for attr in qualname.split('.'): * if isinstance(obj, curry): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_import_module); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_modname) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_modname); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_obj = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":361 * attrs = [] * obj = import_module(modname) * for attr in qualname.split('.'): # <<<<<<<<<<<<<< * if isinstance(obj, curry): * attrs.append('func') */ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_qualname, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_s__6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s__6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 361, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 361, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 361, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 361, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_attr, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":362 * obj = import_module(modname) * for attr in qualname.split('.'): * if isinstance(obj, curry): # <<<<<<<<<<<<<< * attrs.append('func') * obj = obj.func */ __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_7cytoolz_9functoolz_curry); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":363 * for attr in qualname.split('.'): * if isinstance(obj, curry): * attrs.append('func') # <<<<<<<<<<<<<< * obj = obj.func * obj = getattr(obj, attr, None) */ __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_attrs, __pyx_n_s_func); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 363, __pyx_L1_error) /* "cytoolz/functoolz.pyx":364 * if isinstance(obj, curry): * attrs.append('func') * obj = obj.func # <<<<<<<<<<<<<< * obj = getattr(obj, attr, None) * if obj is None: */ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_func); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":362 * obj = import_module(modname) * for attr in qualname.split('.'): * if isinstance(obj, curry): # <<<<<<<<<<<<<< * attrs.append('func') * obj = obj.func */ } /* "cytoolz/functoolz.pyx":365 * attrs.append('func') * obj = obj.func * obj = getattr(obj, attr, None) # <<<<<<<<<<<<<< * if obj is None: * break */ __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_obj, __pyx_v_attr, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":366 * obj = obj.func * obj = getattr(obj, attr, None) * if obj is None: # <<<<<<<<<<<<<< * break * attrs.append(attr) */ __pyx_t_2 = (__pyx_v_obj == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "cytoolz/functoolz.pyx":367 * obj = getattr(obj, attr, None) * if obj is None: * break # <<<<<<<<<<<<<< * attrs.append(attr) * if isinstance(obj, curry) and obj.func is func: */ goto __pyx_L8_break; /* "cytoolz/functoolz.pyx":366 * obj = obj.func * obj = getattr(obj, attr, None) * if obj is None: # <<<<<<<<<<<<<< * break * attrs.append(attr) */ } /* "cytoolz/functoolz.pyx":368 * if obj is None: * break * attrs.append(attr) # <<<<<<<<<<<<<< * if isinstance(obj, curry) and obj.func is func: * is_decorated = obj is self */ __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_attrs, __pyx_v_attr); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 368, __pyx_L1_error) /* "cytoolz/functoolz.pyx":361 * attrs = [] * obj = import_module(modname) * for attr in qualname.split('.'): # <<<<<<<<<<<<<< * if isinstance(obj, curry): * attrs.append('func') */ } __pyx_L8_break:; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/functoolz.pyx":369 * break * attrs.append(attr) * if isinstance(obj, curry) and obj.func is func: # <<<<<<<<<<<<<< * is_decorated = obj is self * qualname = '.'.join(attrs) */ __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_7cytoolz_9functoolz_curry); __pyx_t_9 = (__pyx_t_2 != 0); if (__pyx_t_9) { } else { __pyx_t_3 = __pyx_t_9; goto __pyx_L12_bool_binop_done; } __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_func); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = (__pyx_t_4 == __pyx_v_func); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = (__pyx_t_9 != 0); __pyx_t_3 = __pyx_t_2; __pyx_L12_bool_binop_done:; if (__pyx_t_3) { /* "cytoolz/functoolz.pyx":370 * attrs.append(attr) * if isinstance(obj, curry) and obj.func is func: * is_decorated = obj is self # <<<<<<<<<<<<<< * qualname = '.'.join(attrs) * func = '%s:%s' % (modname, qualname) */ __pyx_t_3 = (__pyx_v_obj == ((PyObject *)__pyx_v_self)); __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_is_decorated, __pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/functoolz.pyx":371 * if isinstance(obj, curry) and obj.func is func: * is_decorated = obj is self * qualname = '.'.join(attrs) # <<<<<<<<<<<<<< * func = '%s:%s' % (modname, qualname) * */ __pyx_t_4 = __Pyx_PyString_Join(__pyx_kp_s__6, __pyx_v_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_qualname, __pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/functoolz.pyx":372 * is_decorated = obj is self * qualname = '.'.join(attrs) * func = '%s:%s' % (modname, qualname) # <<<<<<<<<<<<<< * * state = (type(self), func, self.args, self.keywords, is_decorated) */ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_modname); __Pyx_GIVEREF(__pyx_v_modname); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_modname); __Pyx_INCREF(__pyx_v_qualname); __Pyx_GIVEREF(__pyx_v_qualname); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_qualname); __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_func, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":369 * break * attrs.append(attr) * if isinstance(obj, curry) and obj.func is func: # <<<<<<<<<<<<<< * is_decorated = obj is self * qualname = '.'.join(attrs) */ } /* "cytoolz/functoolz.pyx":358 * qualname = getattr(func, '__name__', None) * is_decorated = None * if modname and qualname: # <<<<<<<<<<<<<< * attrs = [] * obj = import_module(modname) */ } /* "cytoolz/functoolz.pyx":374 * func = '%s:%s' % (modname, qualname) * * state = (type(self), func, self.args, self.keywords, is_decorated) # <<<<<<<<<<<<<< * return (_restore_curry, state) * */ __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_func); __Pyx_INCREF(__pyx_v_self->args); __Pyx_GIVEREF(__pyx_v_self->args); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_self->args); __Pyx_INCREF(__pyx_v_self->keywords); __Pyx_GIVEREF(__pyx_v_self->keywords); PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_self->keywords); __Pyx_INCREF(__pyx_v_is_decorated); __Pyx_GIVEREF(__pyx_v_is_decorated); PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_is_decorated); __pyx_v_state = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":375 * * state = (type(self), func, self.args, self.keywords, is_decorated) * return (_restore_curry, state) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_restore_curry); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_state); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":351 * return sig.replace(parameters=newparams) * * def __reduce__(self): # <<<<<<<<<<<<<< * func = self.func * modname = getattr(func, '__module__', None) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("cytoolz.functoolz.curry.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_func); __Pyx_XDECREF(__pyx_v_modname); __Pyx_XDECREF(__pyx_v_qualname); __Pyx_XDECREF(__pyx_v_is_decorated); __Pyx_XDECREF(__pyx_v_attrs); __Pyx_XDECREF(__pyx_v_obj); __Pyx_XDECREF(__pyx_v_attr); __Pyx_XDECREF(__pyx_v_state); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pxd":11 * * cdef class curry: * cdef readonly object _sigspec # <<<<<<<<<<<<<< * cdef readonly object _has_unknown_args * cdef readonly object func */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_8_sigspec_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_8_sigspec_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_8_sigspec___get__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_8_sigspec___get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_sigspec); __pyx_r = __pyx_v_self->_sigspec; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pxd":12 * cdef class curry: * cdef readonly object _sigspec * cdef readonly object _has_unknown_args # <<<<<<<<<<<<<< * cdef readonly object func * cdef readonly tuple args */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_17_has_unknown_args_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_17_has_unknown_args_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_17_has_unknown_args___get__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_17_has_unknown_args___get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->_has_unknown_args); __pyx_r = __pyx_v_self->_has_unknown_args; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pxd":13 * cdef readonly object _sigspec * cdef readonly object _has_unknown_args * cdef readonly object func # <<<<<<<<<<<<<< * cdef readonly tuple args * cdef readonly dict keywords */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_4func_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_4func_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_4func___get__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_4func___get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__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; } /* "cytoolz/functoolz.pxd":14 * cdef readonly object _has_unknown_args * cdef readonly object func * cdef readonly tuple args # <<<<<<<<<<<<<< * cdef readonly dict keywords * cdef public object __doc__ */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_4args_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_4args_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_4args___get__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_4args___get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->args); __pyx_r = __pyx_v_self->args; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pxd":15 * cdef readonly object func * cdef readonly tuple args * cdef readonly dict keywords # <<<<<<<<<<<<<< * cdef public object __doc__ * cdef public object __name__ */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_8keywords_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_8keywords_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_8keywords___get__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_8keywords___get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->keywords); __pyx_r = __pyx_v_self->keywords; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pxd":16 * cdef readonly tuple args * cdef readonly dict keywords * cdef public object __doc__ # <<<<<<<<<<<<<< * cdef public object __name__ * cdef public object __module__ */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_7__doc___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_7__doc___1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_7__doc_____get__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_7__doc_____get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->__doc__); __pyx_r = __pyx_v_self->__doc__; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_5curry_7__doc___3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_5curry_7__doc___3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_7__doc___2__set__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_5curry_7__doc___2__set__(struct __pyx_obj_7cytoolz_9functoolz_curry *__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->__doc__); __Pyx_DECREF(__pyx_v_self->__doc__); __pyx_v_self->__doc__ = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_5curry_7__doc___5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_5curry_7__doc___5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_7__doc___4__del__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_5curry_7__doc___4__del__(struct __pyx_obj_7cytoolz_9functoolz_curry *__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->__doc__); __Pyx_DECREF(__pyx_v_self->__doc__); __pyx_v_self->__doc__ = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pxd":17 * cdef readonly dict keywords * cdef public object __doc__ * cdef public object __name__ # <<<<<<<<<<<<<< * cdef public object __module__ * cdef public object __qualname__ */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_8__name___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_8__name___1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_8__name_____get__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_8__name_____get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__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_7cytoolz_9functoolz_5curry_8__name___3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_5curry_8__name___3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_8__name___2__set__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_5curry_8__name___2__set__(struct __pyx_obj_7cytoolz_9functoolz_curry *__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_7cytoolz_9functoolz_5curry_8__name___5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_5curry_8__name___5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_8__name___4__del__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_5curry_8__name___4__del__(struct __pyx_obj_7cytoolz_9functoolz_curry *__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; } /* "cytoolz/functoolz.pxd":18 * cdef public object __doc__ * cdef public object __name__ * cdef public object __module__ # <<<<<<<<<<<<<< * cdef public object __qualname__ * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_10__module___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_10__module___1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_10__module_____get__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_10__module_____get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->__module__); __pyx_r = __pyx_v_self->__module__; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_5curry_10__module___3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_5curry_10__module___3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_10__module___2__set__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_5curry_10__module___2__set__(struct __pyx_obj_7cytoolz_9functoolz_curry *__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->__module__); __Pyx_DECREF(__pyx_v_self->__module__); __pyx_v_self->__module__ = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_5curry_10__module___5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_5curry_10__module___5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_10__module___4__del__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_5curry_10__module___4__del__(struct __pyx_obj_7cytoolz_9functoolz_curry *__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->__module__); __Pyx_DECREF(__pyx_v_self->__module__); __pyx_v_self->__module__ = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pxd":19 * cdef public object __name__ * cdef public object __module__ * cdef public object __qualname__ # <<<<<<<<<<<<<< * * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_12__qualname___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_5curry_12__qualname___1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_12__qualname_____get__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_5curry_12__qualname_____get__(struct __pyx_obj_7cytoolz_9functoolz_curry *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->__qualname__); __pyx_r = __pyx_v_self->__qualname__; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_5curry_12__qualname___3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_5curry_12__qualname___3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_12__qualname___2__set__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_5curry_12__qualname___2__set__(struct __pyx_obj_7cytoolz_9functoolz_curry *__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->__qualname__); __Pyx_DECREF(__pyx_v_self->__qualname__); __pyx_v_self->__qualname__ = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_5curry_12__qualname___5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_5curry_12__qualname___5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_5curry_12__qualname___4__del__(((struct __pyx_obj_7cytoolz_9functoolz_curry *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_5curry_12__qualname___4__del__(struct __pyx_obj_7cytoolz_9functoolz_curry *__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->__qualname__); __Pyx_DECREF(__pyx_v_self->__qualname__); __pyx_v_self->__qualname__ = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":378 * * * cpdef object _restore_curry(cls, func, args, kwargs, is_decorated): # <<<<<<<<<<<<<< * if isinstance(func, str): * modname, qualname = func.rsplit(':', 1) */ static PyObject *__pyx_pw_7cytoolz_9functoolz_9_restore_curry(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9functoolz__restore_curry(PyObject *__pyx_v_cls, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, PyObject *__pyx_v_is_decorated, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_v_modname = NULL; PyObject *__pyx_v_qualname = NULL; PyObject *__pyx_v_obj = NULL; PyObject *__pyx_v_attr = 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)(PyObject *); Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); __Pyx_RefNannySetupContext("_restore_curry", 0); __Pyx_INCREF(__pyx_v_func); /* "cytoolz/functoolz.pyx":379 * * cpdef object _restore_curry(cls, func, args, kwargs, is_decorated): * if isinstance(func, str): # <<<<<<<<<<<<<< * modname, qualname = func.rsplit(':', 1) * obj = import_module(modname) */ __pyx_t_1 = PyString_Check(__pyx_v_func); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":380 * cpdef object _restore_curry(cls, func, args, kwargs, is_decorated): * if isinstance(func, str): * modname, qualname = func.rsplit(':', 1) # <<<<<<<<<<<<<< * obj = import_module(modname) * for attr in qualname.split('.'): */ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_func, __pyx_n_s_rsplit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __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; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(0, 380, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); } else { __pyx_t_3 = PyList_GET_ITEM(sequence, 0); __pyx_t_5 = PyList_GET_ITEM(sequence, 1); } __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); #else __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 380, __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_ERR(0, 380, __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_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_5); if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 380, __pyx_L1_error) __pyx_t_7 = NULL; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_unpacking_done; __pyx_L4_unpacking_failed:; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); __PYX_ERR(0, 380, __pyx_L1_error) __pyx_L5_unpacking_done:; } __pyx_v_modname = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_qualname = __pyx_t_5; __pyx_t_5 = 0; /* "cytoolz/functoolz.pyx":381 * if isinstance(func, str): * modname, qualname = func.rsplit(':', 1) * obj = import_module(modname) # <<<<<<<<<<<<<< * for attr in qualname.split('.'): * obj = getattr(obj, attr) */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_import_module); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_v_modname) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_modname); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_obj = __pyx_t_4; __pyx_t_4 = 0; /* "cytoolz/functoolz.pyx":382 * modname, qualname = func.rsplit(':', 1) * obj = import_module(modname) * for attr in qualname.split('.'): # <<<<<<<<<<<<<< * obj = getattr(obj, attr) * if is_decorated: */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_qualname, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_3, __pyx_kp_s__6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_s__6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_5 = __pyx_t_4; __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_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 382, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 382, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 382, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } } else { __pyx_t_4 = __pyx_t_9(__pyx_t_5); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 382, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_attr, __pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/functoolz.pyx":383 * obj = import_module(modname) * for attr in qualname.split('.'): * obj = getattr(obj, attr) # <<<<<<<<<<<<<< * if is_decorated: * return obj */ __pyx_t_4 = __Pyx_GetAttr(__pyx_v_obj, __pyx_v_attr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/functoolz.pyx":382 * modname, qualname = func.rsplit(':', 1) * obj = import_module(modname) * for attr in qualname.split('.'): # <<<<<<<<<<<<<< * obj = getattr(obj, attr) * if is_decorated: */ } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "cytoolz/functoolz.pyx":384 * for attr in qualname.split('.'): * obj = getattr(obj, attr) * if is_decorated: # <<<<<<<<<<<<<< * return obj * func = obj.func */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_is_decorated); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 384, __pyx_L1_error) if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":385 * obj = getattr(obj, attr) * if is_decorated: * return obj # <<<<<<<<<<<<<< * func = obj.func * obj = cls(func, *args, **(kwargs or {})) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_obj); __pyx_r = __pyx_v_obj; goto __pyx_L0; /* "cytoolz/functoolz.pyx":384 * for attr in qualname.split('.'): * obj = getattr(obj, attr) * if is_decorated: # <<<<<<<<<<<<<< * return obj * func = obj.func */ } /* "cytoolz/functoolz.pyx":386 * if is_decorated: * return obj * func = obj.func # <<<<<<<<<<<<<< * obj = cls(func, *args, **(kwargs or {})) * return obj */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_func); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_func, __pyx_t_5); __pyx_t_5 = 0; /* "cytoolz/functoolz.pyx":379 * * cpdef object _restore_curry(cls, func, args, kwargs, is_decorated): * if isinstance(func, str): # <<<<<<<<<<<<<< * modname, qualname = func.rsplit(':', 1) * obj = import_module(modname) */ } /* "cytoolz/functoolz.pyx":387 * return obj * func = obj.func * obj = cls(func, *args, **(kwargs or {})) # <<<<<<<<<<<<<< * return obj * */ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_func); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __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_2 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 387, __pyx_L1_error) if (!__pyx_t_2) { } else { __Pyx_INCREF(__pyx_v_kwargs); __pyx_t_5 = __pyx_v_kwargs; goto __pyx_L9_bool_binop_done; } __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_t_6); __pyx_t_5 = __pyx_t_6; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_L9_bool_binop_done:; if (unlikely(__pyx_t_5 == Py_None)) { PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType"); __PYX_ERR(0, 387, __pyx_L1_error) } if (likely(PyDict_CheckExact(__pyx_t_5))) { __pyx_t_4 = PyDict_Copy(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __pyx_t_4 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_cls, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 387, __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_XDECREF_SET(__pyx_v_obj, __pyx_t_5); __pyx_t_5 = 0; /* "cytoolz/functoolz.pyx":388 * func = obj.func * obj = cls(func, *args, **(kwargs or {})) * return obj # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_obj); __pyx_r = __pyx_v_obj; goto __pyx_L0; /* "cytoolz/functoolz.pyx":378 * * * cpdef object _restore_curry(cls, func, args, kwargs, is_decorated): # <<<<<<<<<<<<<< * if isinstance(func, str): * modname, qualname = func.rsplit(':', 1) */ /* 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("cytoolz.functoolz._restore_curry", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_modname); __Pyx_XDECREF(__pyx_v_qualname); __Pyx_XDECREF(__pyx_v_obj); __Pyx_XDECREF(__pyx_v_attr); __Pyx_XDECREF(__pyx_v_func); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_9_restore_curry(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_8_restore_curry[] = "_restore_curry(cls, func, args, kwargs, is_decorated)"; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_9_restore_curry = {"_restore_curry", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9functoolz_9_restore_curry, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9functoolz_8_restore_curry}; static PyObject *__pyx_pw_7cytoolz_9functoolz_9_restore_curry(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_cls = 0; PyObject *__pyx_v_func = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_v_is_decorated = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_restore_curry (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_func,&__pyx_n_s_args,&__pyx_n_s_kwargs,&__pyx_n_s_is_decorated,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); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cls)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_restore_curry", 1, 5, 5, 1); __PYX_ERR(0, 378, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_restore_curry", 1, 5, 5, 2); __PYX_ERR(0, 378, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_restore_curry", 1, 5, 5, 3); __PYX_ERR(0, 378, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_is_decorated)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("_restore_curry", 1, 5, 5, 4); __PYX_ERR(0, 378, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_restore_curry") < 0)) __PYX_ERR(0, 378, __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_cls = values[0]; __pyx_v_func = values[1]; __pyx_v_args = values[2]; __pyx_v_kwargs = values[3]; __pyx_v_is_decorated = values[4]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("_restore_curry", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 378, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.functoolz._restore_curry", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9functoolz_8_restore_curry(__pyx_self, __pyx_v_cls, __pyx_v_func, __pyx_v_args, __pyx_v_kwargs, __pyx_v_is_decorated); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_8_restore_curry(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_func, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, PyObject *__pyx_v_is_decorated) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("_restore_curry", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9functoolz__restore_curry(__pyx_v_cls, __pyx_v_func, __pyx_v_args, __pyx_v_kwargs, __pyx_v_is_decorated, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.functoolz._restore_curry", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":391 * * * cpdef object memoize(object func, object cache=None, object key=None): # <<<<<<<<<<<<<< * """ * Cache a function's result for speedy future evaluation */ static PyObject *__pyx_pw_7cytoolz_9functoolz_11memoize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9functoolz_memoize(PyObject *__pyx_v_func, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9functoolz_memoize *__pyx_optional_args) { PyObject *__pyx_v_cache = ((PyObject *)Py_None); PyObject *__pyx_v_key = ((PyObject *)Py_None); PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("memoize", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_cache = __pyx_optional_args->cache; if (__pyx_optional_args->__pyx_n > 1) { __pyx_v_key = __pyx_optional_args->key; } } } /* "cytoolz/functoolz.pyx":428 * ... return x + y * """ * return _memoize(func, cache, key) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_func); __Pyx_INCREF(__pyx_v_cache); __Pyx_GIVEREF(__pyx_v_cache); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_cache); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_key); __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9functoolz__memoize), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 428, __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; /* "cytoolz/functoolz.pyx":391 * * * cpdef object memoize(object func, object cache=None, object key=None): # <<<<<<<<<<<<<< * """ * Cache a function's result for speedy future evaluation */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.functoolz.memoize", __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_7cytoolz_9functoolz_11memoize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_10memoize[] = "memoize(func, cache=None, key=None)\n\n Cache a function's result for speedy future evaluation\n\n Considerations:\n Trades memory for speed.\n Only use on pure functions.\n\n >>> def add(x, y): return x + y\n >>> add = memoize(add)\n\n Or use as a decorator\n\n >>> @memoize\n ... def add(x, y):\n ... return x + y\n\n Use the ``cache`` keyword to provide a dict-like object as an initial cache\n\n >>> @memoize(cache={(1, 2): 3})\n ... def add(x, y):\n ... return x + y\n\n Note that the above works as a decorator because ``memoize`` is curried.\n\n It is also possible to provide a ``key(args, kwargs)`` function that\n calculates keys used for the cache, which receives an ``args`` tuple and\n ``kwargs`` dict as input, and must return a hashable value. However,\n the default key function should be sufficient most of the time.\n\n >>> # Use key function that ignores extraneous keyword arguments\n >>> @memoize(key=lambda args, kwargs: args)\n ... def add(x, y, verbose=False):\n ... if verbose:\n ... print('Calculating %s + %s' % (x, y))\n ... return x + y\n "; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_11memoize = {"memoize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9functoolz_11memoize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9functoolz_10memoize}; static PyObject *__pyx_pw_7cytoolz_9functoolz_11memoize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_func = 0; PyObject *__pyx_v_cache = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("memoize (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_cache,&__pyx_n_s_key,0}; PyObject* values[3] = {0,0,0}; 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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cache); if (value) { values[1] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "memoize") < 0)) __PYX_ERR(0, 391, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_func = values[0]; __pyx_v_cache = values[1]; __pyx_v_key = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("memoize", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 391, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.functoolz.memoize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9functoolz_10memoize(__pyx_self, __pyx_v_func, __pyx_v_cache, __pyx_v_key); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_10memoize(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_cache, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_7cytoolz_9functoolz_memoize __pyx_t_2; __Pyx_RefNannySetupContext("memoize", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 2; __pyx_t_2.cache = __pyx_v_cache; __pyx_t_2.key = __pyx_v_key; __pyx_t_1 = __pyx_f_7cytoolz_9functoolz_memoize(__pyx_v_func, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.functoolz.memoize", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":434 * * property __doc__: * def __get__(self): # <<<<<<<<<<<<<< * return self.func.__doc__ * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_8_memoize_7__doc___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_8_memoize_7__doc___1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_8_memoize_7__doc_____get__(((struct __pyx_obj_7cytoolz_9functoolz__memoize *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_8_memoize_7__doc_____get__(struct __pyx_obj_7cytoolz_9functoolz__memoize *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); /* "cytoolz/functoolz.pyx":435 * property __doc__: * def __get__(self): * return self.func.__doc__ # <<<<<<<<<<<<<< * * property __name__: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->func, __pyx_n_s_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":434 * * property __doc__: * def __get__(self): # <<<<<<<<<<<<<< * return self.func.__doc__ * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.functoolz._memoize.__doc__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":438 * * property __name__: * def __get__(self): # <<<<<<<<<<<<<< * return self.func.__name__ * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_8_memoize_8__name___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_8_memoize_8__name___1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_8_memoize_8__name_____get__(((struct __pyx_obj_7cytoolz_9functoolz__memoize *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_8_memoize_8__name_____get__(struct __pyx_obj_7cytoolz_9functoolz__memoize *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__get__", 0); /* "cytoolz/functoolz.pyx":439 * property __name__: * def __get__(self): * return self.func.__name__ # <<<<<<<<<<<<<< * * property __wrapped__: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->func, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":438 * * property __name__: * def __get__(self): # <<<<<<<<<<<<<< * return self.func.__name__ * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.functoolz._memoize.__name__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":442 * * property __wrapped__: * def __get__(self): # <<<<<<<<<<<<<< * return self.func * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_8_memoize_11__wrapped___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_8_memoize_11__wrapped___1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_8_memoize_11__wrapped_____get__(((struct __pyx_obj_7cytoolz_9functoolz__memoize *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_8_memoize_11__wrapped_____get__(struct __pyx_obj_7cytoolz_9functoolz__memoize *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "cytoolz/functoolz.pyx":443 * property __wrapped__: * def __get__(self): * return self.func # <<<<<<<<<<<<<< * * def __cinit__(self, func, cache, key): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->func); __pyx_r = __pyx_v_self->func; goto __pyx_L0; /* "cytoolz/functoolz.pyx":442 * * property __wrapped__: * def __get__(self): # <<<<<<<<<<<<<< * return self.func * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":445 * return self.func * * def __cinit__(self, func, cache, key): # <<<<<<<<<<<<<< * self.func = func * if cache is None: */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_8_memoize_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_8_memoize_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_func = 0; PyObject *__pyx_v_cache = 0; PyObject *__pyx_v_key = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_cache,&__pyx_n_s_key,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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cache)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); __PYX_ERR(0, 445, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); __PYX_ERR(0, 445, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 445, __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_func = values[0]; __pyx_v_cache = values[1]; __pyx_v_key = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 445, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.functoolz._memoize.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9functoolz_8_memoize___cinit__(((struct __pyx_obj_7cytoolz_9functoolz__memoize *)__pyx_v_self), __pyx_v_func, __pyx_v_cache, __pyx_v_key); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_8_memoize___cinit__(struct __pyx_obj_7cytoolz_9functoolz__memoize *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_cache, PyObject *__pyx_v_key) { 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; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/functoolz.pyx":446 * * def __cinit__(self, func, cache, key): * self.func = func # <<<<<<<<<<<<<< * if cache is None: * self.cache = PyDict_New() */ __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; /* "cytoolz/functoolz.pyx":447 * def __cinit__(self, func, cache, key): * self.func = func * if cache is None: # <<<<<<<<<<<<<< * self.cache = PyDict_New() * else: */ __pyx_t_1 = (__pyx_v_cache == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":448 * self.func = func * if cache is None: * self.cache = PyDict_New() # <<<<<<<<<<<<<< * else: * self.cache = cache */ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->cache); __Pyx_DECREF(__pyx_v_self->cache); __pyx_v_self->cache = __pyx_t_3; __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":447 * def __cinit__(self, func, cache, key): * self.func = func * if cache is None: # <<<<<<<<<<<<<< * self.cache = PyDict_New() * else: */ goto __pyx_L3; } /* "cytoolz/functoolz.pyx":450 * self.cache = PyDict_New() * else: * self.cache = cache # <<<<<<<<<<<<<< * self.key = key * */ /*else*/ { __Pyx_INCREF(__pyx_v_cache); __Pyx_GIVEREF(__pyx_v_cache); __Pyx_GOTREF(__pyx_v_self->cache); __Pyx_DECREF(__pyx_v_self->cache); __pyx_v_self->cache = __pyx_v_cache; } __pyx_L3:; /* "cytoolz/functoolz.pyx":451 * else: * self.cache = cache * self.key = key # <<<<<<<<<<<<<< * * try: */ __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); __Pyx_GOTREF(__pyx_v_self->key); __Pyx_DECREF(__pyx_v_self->key); __pyx_v_self->key = __pyx_v_key; /* "cytoolz/functoolz.pyx":453 * self.key = key * * try: # <<<<<<<<<<<<<< * self.may_have_kwargs = has_keywords(func) is not False * # Is unary function (single arg, no variadic argument or keywords)? */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __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:*/ { /* "cytoolz/functoolz.pyx":454 * * try: * self.may_have_kwargs = has_keywords(func) is not False # <<<<<<<<<<<<<< * # Is unary function (single arg, no variadic argument or keywords)? * self.is_unary = is_arity(1, func) */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_has_keywords); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 454, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_func) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_func); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = (__pyx_t_3 != Py_False); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->may_have_kwargs = __pyx_t_2; /* "cytoolz/functoolz.pyx":456 * self.may_have_kwargs = has_keywords(func) is not False * # Is unary function (single arg, no variadic argument or keywords)? * self.is_unary = is_arity(1, func) # <<<<<<<<<<<<<< * except TypeError: * self.is_unary = False */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_is_arity); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 456, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_9 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_int_1, __pyx_v_func}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L4_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_int_1, __pyx_v_func}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L4_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 456, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL; } __Pyx_INCREF(__pyx_int_1); __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_int_1); __Pyx_INCREF(__pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_v_func); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L4_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_self->is_unary = __pyx_t_2; /* "cytoolz/functoolz.pyx":453 * self.key = key * * try: # <<<<<<<<<<<<<< * self.may_have_kwargs = has_keywords(func) is not False * # Is unary function (single arg, no variadic argument or keywords)? */ } __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_L9_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __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; /* "cytoolz/functoolz.pyx":457 * # Is unary function (single arg, no variadic argument or keywords)? * self.is_unary = is_arity(1, func) * except TypeError: # <<<<<<<<<<<<<< * self.is_unary = False * self.may_have_kwargs = True */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_9) { __Pyx_AddTraceback("cytoolz.functoolz._memoize.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_7, &__pyx_t_10) < 0) __PYX_ERR(0, 457, __pyx_L6_except_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_10); /* "cytoolz/functoolz.pyx":458 * self.is_unary = is_arity(1, func) * except TypeError: * self.is_unary = False # <<<<<<<<<<<<<< * self.may_have_kwargs = True * */ __pyx_v_self->is_unary = 0; /* "cytoolz/functoolz.pyx":459 * except TypeError: * self.is_unary = False * self.may_have_kwargs = True # <<<<<<<<<<<<<< * * def __call__(self, *args, **kwargs): */ __pyx_v_self->may_have_kwargs = 1; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L5_exception_handled; } goto __pyx_L6_except_error; __pyx_L6_except_error:; /* "cytoolz/functoolz.pyx":453 * self.key = key * * try: # <<<<<<<<<<<<<< * self.may_have_kwargs = has_keywords(func) is not False * # Is unary function (single arg, no variadic argument or keywords)? */ __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_L9_try_end:; } /* "cytoolz/functoolz.pyx":445 * return self.func * * def __cinit__(self, func, cache, key): # <<<<<<<<<<<<<< * self.func = func * if cache is None: */ /* 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_8); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("cytoolz.functoolz._memoize.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":461 * self.may_have_kwargs = True * * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< * cdef object key * if self.key is not None: */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_8_memoize_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_8_memoize_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 1))) return NULL; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_7cytoolz_9functoolz_8_memoize_2__call__(((struct __pyx_obj_7cytoolz_9functoolz__memoize *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_8_memoize_2__call__(struct __pyx_obj_7cytoolz_9functoolz__memoize *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_key = 0; 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; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("__call__", 0); /* "cytoolz/functoolz.pyx":463 * def __call__(self, *args, **kwargs): * cdef object key * if self.key is not None: # <<<<<<<<<<<<<< * key = self.key(args, kwargs) * elif self.is_unary: */ __pyx_t_1 = (__pyx_v_self->key != Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":464 * cdef object key * if self.key is not None: * key = self.key(args, kwargs) # <<<<<<<<<<<<<< * elif self.is_unary: * key = args[0] */ __Pyx_INCREF(__pyx_v_self->key); __pyx_t_4 = __pyx_v_self->key; __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_args, __pyx_v_kwargs}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_args, __pyx_v_kwargs}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_args); __Pyx_GIVEREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_args); __Pyx_INCREF(__pyx_v_kwargs); __Pyx_GIVEREF(__pyx_v_kwargs); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_kwargs); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_key = __pyx_t_3; __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":463 * def __call__(self, *args, **kwargs): * cdef object key * if self.key is not None: # <<<<<<<<<<<<<< * key = self.key(args, kwargs) * elif self.is_unary: */ goto __pyx_L3; } /* "cytoolz/functoolz.pyx":465 * if self.key is not None: * key = self.key(args, kwargs) * elif self.is_unary: # <<<<<<<<<<<<<< * key = args[0] * elif self.may_have_kwargs: */ __pyx_t_2 = (__pyx_v_self->is_unary != 0); if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":466 * key = self.key(args, kwargs) * elif self.is_unary: * key = args[0] # <<<<<<<<<<<<<< * elif self.may_have_kwargs: * key = (args or None, */ __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_key = __pyx_t_3; __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":465 * if self.key is not None: * key = self.key(args, kwargs) * elif self.is_unary: # <<<<<<<<<<<<<< * key = args[0] * elif self.may_have_kwargs: */ goto __pyx_L3; } /* "cytoolz/functoolz.pyx":467 * elif self.is_unary: * key = args[0] * elif self.may_have_kwargs: # <<<<<<<<<<<<<< * key = (args or None, * PyFrozenSet_New(kwargs.items()) if kwargs else None) */ __pyx_t_2 = (__pyx_v_self->may_have_kwargs != 0); if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":468 * key = args[0] * elif self.may_have_kwargs: * key = (args or None, # <<<<<<<<<<<<<< * PyFrozenSet_New(kwargs.items()) if kwargs else None) * else: */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_args); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 468, __pyx_L1_error) if (!__pyx_t_2) { } else { __Pyx_INCREF(__pyx_v_args); __pyx_t_3 = __pyx_v_args; goto __pyx_L4_bool_binop_done; } __Pyx_INCREF(Py_None); __pyx_t_3 = Py_None; __pyx_L4_bool_binop_done:; /* "cytoolz/functoolz.pyx":469 * elif self.may_have_kwargs: * key = (args or None, * PyFrozenSet_New(kwargs.items()) if kwargs else None) # <<<<<<<<<<<<<< * else: * key = args */ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_kwargs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 469, __pyx_L1_error) if (__pyx_t_2) { __pyx_t_7 = __Pyx_PyDict_Items(__pyx_v_kwargs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = PyFrozenSet_New(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_4 = __pyx_t_5; __pyx_t_5 = 0; } else { __Pyx_INCREF(Py_None); __pyx_t_4 = Py_None; } /* "cytoolz/functoolz.pyx":468 * key = args[0] * elif self.may_have_kwargs: * key = (args or None, # <<<<<<<<<<<<<< * PyFrozenSet_New(kwargs.items()) if kwargs else None) * else: */ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_v_key = __pyx_t_5; __pyx_t_5 = 0; /* "cytoolz/functoolz.pyx":467 * elif self.is_unary: * key = args[0] * elif self.may_have_kwargs: # <<<<<<<<<<<<<< * key = (args or None, * PyFrozenSet_New(kwargs.items()) if kwargs else None) */ goto __pyx_L3; } /* "cytoolz/functoolz.pyx":471 * PyFrozenSet_New(kwargs.items()) if kwargs else None) * else: * key = args # <<<<<<<<<<<<<< * * if key in self.cache: */ /*else*/ { __Pyx_INCREF(__pyx_v_args); __pyx_v_key = __pyx_v_args; } __pyx_L3:; /* "cytoolz/functoolz.pyx":473 * key = args * * if key in self.cache: # <<<<<<<<<<<<<< * return self.cache[key] * else: */ __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_self->cache, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 473, __pyx_L1_error) __pyx_t_1 = (__pyx_t_2 != 0); if (__pyx_t_1) { /* "cytoolz/functoolz.pyx":474 * * if key in self.cache: * return self.cache[key] # <<<<<<<<<<<<<< * else: * result = PyObject_Call(self.func, args, kwargs) */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_self->cache, __pyx_v_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":473 * key = args * * if key in self.cache: # <<<<<<<<<<<<<< * return self.cache[key] * else: */ } /* "cytoolz/functoolz.pyx":476 * return self.cache[key] * else: * result = PyObject_Call(self.func, args, kwargs) # <<<<<<<<<<<<<< * self.cache[key] = result * return result */ /*else*/ { __pyx_t_5 = __pyx_v_self->func; __Pyx_INCREF(__pyx_t_5); __pyx_t_4 = PyObject_Call(__pyx_t_5, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_result = __pyx_t_4; __pyx_t_4 = 0; /* "cytoolz/functoolz.pyx":477 * else: * result = PyObject_Call(self.func, args, kwargs) * self.cache[key] = result # <<<<<<<<<<<<<< * return result * */ if (unlikely(PyObject_SetItem(__pyx_v_self->cache, __pyx_v_key, __pyx_v_result) < 0)) __PYX_ERR(0, 477, __pyx_L1_error) /* "cytoolz/functoolz.pyx":478 * result = PyObject_Call(self.func, args, kwargs) * self.cache[key] = result * return result # <<<<<<<<<<<<<< * * def __get__(self, instance, owner): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; } /* "cytoolz/functoolz.pyx":461 * self.may_have_kwargs = True * * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< * cdef object key * if self.key is not None: */ /* 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_7); __Pyx_AddTraceback("cytoolz.functoolz._memoize.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":480 * return result * * def __get__(self, instance, owner): # <<<<<<<<<<<<<< * if instance is None: * return self */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_8_memoize_5__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_instance, PyObject *__pyx_v_owner); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_8_memoize_5__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_instance, PyObject *__pyx_v_owner) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_8_memoize_4__get__(((struct __pyx_obj_7cytoolz_9functoolz__memoize *)__pyx_v_self), ((PyObject *)__pyx_v_instance), ((PyObject *)__pyx_v_owner)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_8_memoize_4__get__(struct __pyx_obj_7cytoolz_9functoolz__memoize *__pyx_v_self, PyObject *__pyx_v_instance, CYTHON_UNUSED PyObject *__pyx_v_owner) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("__get__", 0); /* "cytoolz/functoolz.pyx":481 * * def __get__(self, instance, owner): * if instance is None: # <<<<<<<<<<<<<< * return self * return curry(self, instance) */ __pyx_t_1 = (__pyx_v_instance == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":482 * def __get__(self, instance, owner): * if instance is None: * return self # <<<<<<<<<<<<<< * return curry(self, instance) * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "cytoolz/functoolz.pyx":481 * * def __get__(self, instance, owner): * if instance is None: # <<<<<<<<<<<<<< * return self * return curry(self, instance) */ } /* "cytoolz/functoolz.pyx":483 * if instance is None: * return self * return curry(self, instance) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(__pyx_v_instance); __Pyx_GIVEREF(__pyx_v_instance); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_instance); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9functoolz_curry), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 483, __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; /* "cytoolz/functoolz.pyx":480 * return result * * def __get__(self, instance, owner): # <<<<<<<<<<<<<< * if instance is None: * return self */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("cytoolz.functoolz._memoize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_8_memoize_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_8_memoize_6__reduce_cython__[] = "_memoize.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_8_memoize_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9functoolz_8_memoize_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9functoolz_8_memoize_6__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9functoolz_8_memoize_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_8_memoize_6__reduce_cython__(((struct __pyx_obj_7cytoolz_9functoolz__memoize *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_8_memoize_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9functoolz__memoize *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.functoolz._memoize.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_8_memoize_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_8_memoize_8__setstate_cython__[] = "_memoize.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_8_memoize_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9functoolz_8_memoize_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9functoolz_8_memoize_8__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9functoolz_8_memoize_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_8_memoize_8__setstate_cython__(((struct __pyx_obj_7cytoolz_9functoolz__memoize *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_8_memoize_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9functoolz__memoize *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.functoolz._memoize.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":497 * __module__ = 'cytooz.functoolz' * * def __cinit__(self, *funcs): # <<<<<<<<<<<<<< * self.first = funcs[-1] * self.funcs = tuple(reversed(funcs[:-1])) */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_7Compose_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_7Compose_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_funcs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1; __Pyx_INCREF(__pyx_args); __pyx_v_funcs = __pyx_args; __pyx_r = __pyx_pf_7cytoolz_9functoolz_7Compose___cinit__(((struct __pyx_obj_7cytoolz_9functoolz_Compose *)__pyx_v_self), __pyx_v_funcs); /* function exit code */ __Pyx_XDECREF(__pyx_v_funcs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_7Compose___cinit__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self, PyObject *__pyx_v_funcs) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/functoolz.pyx":498 * * def __cinit__(self, *funcs): * self.first = funcs[-1] # <<<<<<<<<<<<<< * self.funcs = tuple(reversed(funcs[:-1])) * */ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_funcs, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->first); __Pyx_DECREF(__pyx_v_self->first); __pyx_v_self->first = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":499 * def __cinit__(self, *funcs): * self.first = funcs[-1] * self.funcs = tuple(reversed(funcs[:-1])) # <<<<<<<<<<<<<< * * def __call__(self, *args, **kwargs): */ __pyx_t_1 = __Pyx_PyTuple_GetSlice(__pyx_v_funcs, 0, -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_reversed, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __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->funcs); __Pyx_DECREF(__pyx_v_self->funcs); __pyx_v_self->funcs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":497 * __module__ = 'cytooz.functoolz' * * def __cinit__(self, *funcs): # <<<<<<<<<<<<<< * self.first = funcs[-1] * self.funcs = tuple(reversed(funcs[:-1])) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.functoolz.Compose.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":501 * self.funcs = tuple(reversed(funcs[:-1])) * * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< * cdef object func, ret * ret = PyObject_Call(self.first, args, kwargs) */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 1))) return NULL; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_7cytoolz_9functoolz_7Compose_2__call__(((struct __pyx_obj_7cytoolz_9functoolz_Compose *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_2__call__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_func = 0; PyObject *__pyx_v_ret = 0; 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; __Pyx_RefNannySetupContext("__call__", 0); /* "cytoolz/functoolz.pyx":503 * def __call__(self, *args, **kwargs): * cdef object func, ret * ret = PyObject_Call(self.first, args, kwargs) # <<<<<<<<<<<<<< * for func in self.funcs: * ret = func(ret) */ __pyx_t_1 = __pyx_v_self->first; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_ret = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/functoolz.pyx":504 * cdef object func, ret * ret = PyObject_Call(self.first, args, kwargs) * for func in self.funcs: # <<<<<<<<<<<<<< * ret = func(ret) * return ret */ if (unlikely(__pyx_v_self->funcs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 504, __pyx_L1_error) } __pyx_t_2 = __pyx_v_self->funcs; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 504, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":505 * ret = PyObject_Call(self.first, args, kwargs) * for func in self.funcs: * ret = func(ret) # <<<<<<<<<<<<<< * return ret * */ __Pyx_INCREF(__pyx_v_func); __pyx_t_4 = __pyx_v_func; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_ret) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_ret); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF_SET(__pyx_v_ret, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":504 * cdef object func, ret * ret = PyObject_Call(self.first, args, kwargs) * for func in self.funcs: # <<<<<<<<<<<<<< * ret = func(ret) * return ret */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/functoolz.pyx":506 * for func in self.funcs: * ret = func(ret) * return ret # <<<<<<<<<<<<<< * * def __reduce__(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_ret); __pyx_r = __pyx_v_ret; goto __pyx_L0; /* "cytoolz/functoolz.pyx":501 * self.funcs = tuple(reversed(funcs[:-1])) * * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< * cdef object func, ret * ret = PyObject_Call(self.first, args, kwargs) */ /* 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_AddTraceback("cytoolz.functoolz.Compose.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_func); __Pyx_XDECREF(__pyx_v_ret); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":508 * return ret * * def __reduce__(self): # <<<<<<<<<<<<<< * return (Compose, (self.first,), self.funcs) * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_7Compose_4__reduce__[] = "Compose.__reduce__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_7Compose_5__reduce__ = {"__reduce__", (PyCFunction)__pyx_pw_7cytoolz_9functoolz_7Compose_5__reduce__, METH_NOARGS, __pyx_doc_7cytoolz_9functoolz_7Compose_4__reduce__}; static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7Compose_4__reduce__(((struct __pyx_obj_7cytoolz_9functoolz_Compose *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_4__reduce__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__reduce__", 0); /* "cytoolz/functoolz.pyx":509 * * def __reduce__(self): * return (Compose, (self.first,), self.funcs) # <<<<<<<<<<<<<< * * def __setstate__(self, state): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->first); __Pyx_GIVEREF(__pyx_v_self->first); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->first); __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_ptype_7cytoolz_9functoolz_Compose)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7cytoolz_9functoolz_Compose)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_7cytoolz_9functoolz_Compose)); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __Pyx_INCREF(__pyx_v_self->funcs); __Pyx_GIVEREF(__pyx_v_self->funcs); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_self->funcs); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":508 * return ret * * def __reduce__(self): # <<<<<<<<<<<<<< * return (Compose, (self.first,), self.funcs) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.functoolz.Compose.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":511 * return (Compose, (self.first,), self.funcs) * * def __setstate__(self, state): # <<<<<<<<<<<<<< * self.funcs = state * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_7__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_7Compose_6__setstate__[] = "Compose.__setstate__(self, state)"; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_7Compose_7__setstate__ = {"__setstate__", (PyCFunction)__pyx_pw_7cytoolz_9functoolz_7Compose_7__setstate__, METH_O, __pyx_doc_7cytoolz_9functoolz_7Compose_6__setstate__}; static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_7__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7Compose_6__setstate__(((struct __pyx_obj_7cytoolz_9functoolz_Compose *)__pyx_v_self), ((PyObject *)__pyx_v_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_6__setstate__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self, PyObject *__pyx_v_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate__", 0); /* "cytoolz/functoolz.pyx":512 * * def __setstate__(self, state): * self.funcs = state # <<<<<<<<<<<<<< * * def __repr__(self): */ if (!(likely(PyTuple_CheckExact(__pyx_v_state))||((__pyx_v_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_state)->tp_name), 0))) __PYX_ERR(0, 512, __pyx_L1_error) __pyx_t_1 = __pyx_v_state; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->funcs); __Pyx_DECREF(__pyx_v_self->funcs); __pyx_v_self->funcs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":511 * return (Compose, (self.first,), self.funcs) * * def __setstate__(self, state): # <<<<<<<<<<<<<< * self.funcs = state * */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.functoolz.Compose.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":514 * self.funcs = state * * def __repr__(self): # <<<<<<<<<<<<<< * return '{.__class__.__name__}{!r}'.format( * self, tuple(reversed((self.first, ) + self.funcs))) */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_9__repr__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_9__repr__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7Compose_8__repr__(((struct __pyx_obj_7cytoolz_9functoolz_Compose *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_8__repr__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__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_t_5; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("__repr__", 0); /* "cytoolz/functoolz.pyx":515 * * def __repr__(self): * return '{.__class__.__name__}{!r}'.format( # <<<<<<<<<<<<<< * self, tuple(reversed((self.first, ) + self.funcs))) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_class_____name___r, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); /* "cytoolz/functoolz.pyx":516 * def __repr__(self): * return '{.__class__.__name__}{!r}'.format( * self, tuple(reversed((self.first, ) + self.funcs))) # <<<<<<<<<<<<<< * * def __eq__(self, other): */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_self->first); __Pyx_GIVEREF(__pyx_v_self->first); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->first); __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_v_self->funcs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_reversed, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_t_4}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_t_4}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __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_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":514 * self.funcs = state * * def __repr__(self): # <<<<<<<<<<<<<< * return '{.__class__.__name__}{!r}'.format( * self, tuple(reversed((self.first, ) + self.funcs))) */ /* 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_6); __Pyx_AddTraceback("cytoolz.functoolz.Compose.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":518 * self, tuple(reversed((self.first, ) + self.funcs))) * * def __eq__(self, other): # <<<<<<<<<<<<<< * if isinstance(other, Compose): * return other.first == self.first and other.funcs == self.funcs */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_11__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_11__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7Compose_10__eq__(((struct __pyx_obj_7cytoolz_9functoolz_Compose *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_10__eq__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self, PyObject *__pyx_v_other) { 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; __Pyx_RefNannySetupContext("__eq__", 0); /* "cytoolz/functoolz.pyx":519 * * def __eq__(self, other): * if isinstance(other, Compose): # <<<<<<<<<<<<<< * return other.first == self.first and other.funcs == self.funcs * return NotImplemented */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_7cytoolz_9functoolz_Compose); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":520 * def __eq__(self, other): * if isinstance(other, Compose): * return other.first == self.first and other.funcs == self.funcs # <<<<<<<<<<<<<< * return NotImplemented * */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_first); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_v_self->first, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 520, __pyx_L1_error) if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_funcs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_v_self->funcs, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_L4_bool_binop_done:; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":519 * * def __eq__(self, other): * if isinstance(other, Compose): # <<<<<<<<<<<<<< * return other.first == self.first and other.funcs == self.funcs * return NotImplemented */ } /* "cytoolz/functoolz.pyx":521 * if isinstance(other, Compose): * return other.first == self.first and other.funcs == self.funcs * return NotImplemented # <<<<<<<<<<<<<< * * def __ne__(self, other): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_builtin_NotImplemented); __pyx_r = __pyx_builtin_NotImplemented; goto __pyx_L0; /* "cytoolz/functoolz.pyx":518 * self, tuple(reversed((self.first, ) + self.funcs))) * * def __eq__(self, other): # <<<<<<<<<<<<<< * if isinstance(other, Compose): * return other.first == self.first and other.funcs == self.funcs */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("cytoolz.functoolz.Compose.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":523 * return NotImplemented * * def __ne__(self, other): # <<<<<<<<<<<<<< * if isinstance(other, Compose): * return other.first != self.first or other.funcs != self.funcs */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_13__ne__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_13__ne__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7Compose_12__ne__(((struct __pyx_obj_7cytoolz_9functoolz_Compose *)__pyx_v_self), ((PyObject *)__pyx_v_other)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_12__ne__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self, PyObject *__pyx_v_other) { 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; __Pyx_RefNannySetupContext("__ne__", 0); /* "cytoolz/functoolz.pyx":524 * * def __ne__(self, other): * if isinstance(other, Compose): # <<<<<<<<<<<<<< * return other.first != self.first or other.funcs != self.funcs * return NotImplemented */ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_7cytoolz_9functoolz_Compose); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":525 * def __ne__(self, other): * if isinstance(other, Compose): * return other.first != self.first or other.funcs != self.funcs # <<<<<<<<<<<<<< * return NotImplemented * */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_first); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_v_self->first, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 525, __pyx_L1_error) if (!__pyx_t_2) { __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_funcs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_v_self->funcs, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __pyx_t_4; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_L4_bool_binop_done:; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":524 * * def __ne__(self, other): * if isinstance(other, Compose): # <<<<<<<<<<<<<< * return other.first != self.first or other.funcs != self.funcs * return NotImplemented */ } /* "cytoolz/functoolz.pyx":526 * if isinstance(other, Compose): * return other.first != self.first or other.funcs != self.funcs * return NotImplemented # <<<<<<<<<<<<<< * * def __hash__(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_builtin_NotImplemented); __pyx_r = __pyx_builtin_NotImplemented; goto __pyx_L0; /* "cytoolz/functoolz.pyx":523 * return NotImplemented * * def __ne__(self, other): # <<<<<<<<<<<<<< * if isinstance(other, Compose): * return other.first != self.first or other.funcs != self.funcs */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("cytoolz.functoolz.Compose.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":528 * return NotImplemented * * def __hash__(self): # <<<<<<<<<<<<<< * return hash(self.first) ^ hash(self.funcs) * */ /* Python wrapper */ static Py_hash_t __pyx_pw_7cytoolz_9functoolz_7Compose_15__hash__(PyObject *__pyx_v_self); /*proto*/ static Py_hash_t __pyx_pw_7cytoolz_9functoolz_7Compose_15__hash__(PyObject *__pyx_v_self) { Py_hash_t __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__hash__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7Compose_14__hash__(((struct __pyx_obj_7cytoolz_9functoolz_Compose *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static Py_hash_t __pyx_pf_7cytoolz_9functoolz_7Compose_14__hash__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self) { Py_hash_t __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_hash_t __pyx_t_2; Py_hash_t __pyx_t_3; __Pyx_RefNannySetupContext("__hash__", 0); /* "cytoolz/functoolz.pyx":529 * * def __hash__(self): * return hash(self.first) ^ hash(self.funcs) # <<<<<<<<<<<<<< * * def __get__(self, obj, objtype): */ __pyx_t_1 = __pyx_v_self->first; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_hash_t)-1))) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_v_self->funcs; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyObject_Hash(__pyx_t_1); if (unlikely(__pyx_t_3 == ((Py_hash_t)-1))) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = (__pyx_t_2 ^ __pyx_t_3); goto __pyx_L0; /* "cytoolz/functoolz.pyx":528 * return NotImplemented * * def __hash__(self): # <<<<<<<<<<<<<< * return hash(self.first) ^ hash(self.funcs) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.functoolz.Compose.__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; } /* "cytoolz/functoolz.pyx":531 * return hash(self.first) ^ hash(self.funcs) * * def __get__(self, obj, objtype): # <<<<<<<<<<<<<< * if obj is None: * return self */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_17__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_objtype); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_17__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_objtype) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7Compose_16__get__(((struct __pyx_obj_7cytoolz_9functoolz_Compose *)__pyx_v_self), ((PyObject *)__pyx_v_obj), ((PyObject *)__pyx_v_objtype)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_16__get__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_objtype) { 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_t_6; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("__get__", 0); /* "cytoolz/functoolz.pyx":532 * * def __get__(self, obj, objtype): * if obj is None: # <<<<<<<<<<<<<< * return self * elif PY3: */ __pyx_t_1 = (__pyx_v_obj == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":533 * def __get__(self, obj, objtype): * if obj is None: * return self # <<<<<<<<<<<<<< * elif PY3: * return MethodType(self, obj) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "cytoolz/functoolz.pyx":532 * * def __get__(self, obj, objtype): * if obj is None: # <<<<<<<<<<<<<< * return self * elif PY3: */ } /* "cytoolz/functoolz.pyx":534 * if obj is None: * return self * elif PY3: # <<<<<<<<<<<<<< * return MethodType(self, obj) * else: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PY3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":535 * return self * elif PY3: * return MethodType(self, obj) # <<<<<<<<<<<<<< * else: * return MethodType(self, obj, objtype) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MethodType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_obj}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_v_obj}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_obj); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __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; /* "cytoolz/functoolz.pyx":534 * if obj is None: * return self * elif PY3: # <<<<<<<<<<<<<< * return MethodType(self, obj) * else: */ } /* "cytoolz/functoolz.pyx":537 * return MethodType(self, obj) * else: * return MethodType(self, obj, objtype) # <<<<<<<<<<<<<< * * property __wrapped__: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MethodType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[4] = {__pyx_t_7, ((PyObject *)__pyx_v_self), __pyx_v_obj, __pyx_v_objtype}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[4] = {__pyx_t_7, ((PyObject *)__pyx_v_self), __pyx_v_obj, __pyx_v_objtype}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_3); } else #endif { __pyx_t_5 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, ((PyObject *)__pyx_v_self)); __Pyx_INCREF(__pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_v_obj); __Pyx_INCREF(__pyx_v_objtype); __Pyx_GIVEREF(__pyx_v_objtype); PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_6, __pyx_v_objtype); __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __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 = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "cytoolz/functoolz.pyx":531 * return hash(self.first) ^ hash(self.funcs) * * def __get__(self, obj, objtype): # <<<<<<<<<<<<<< * if obj is None: * 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_7); __Pyx_AddTraceback("cytoolz.functoolz.Compose.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":540 * * property __wrapped__: * def __get__(self): # <<<<<<<<<<<<<< * return self.first * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_11__wrapped___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_11__wrapped___1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7Compose_11__wrapped_____get__(((struct __pyx_obj_7cytoolz_9functoolz_Compose *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_11__wrapped_____get__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); /* "cytoolz/functoolz.pyx":541 * property __wrapped__: * def __get__(self): * return self.first # <<<<<<<<<<<<<< * * property __signature__: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->first); __pyx_r = __pyx_v_self->first; goto __pyx_L0; /* "cytoolz/functoolz.pyx":540 * * property __wrapped__: * def __get__(self): # <<<<<<<<<<<<<< * return self.first * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":544 * * property __signature__: * def __get__(self): # <<<<<<<<<<<<<< * base = inspect.signature(self.first) * last = inspect.signature(self.funcs[-1]) */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_13__signature___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_13__signature___1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7Compose_13__signature_____get__(((struct __pyx_obj_7cytoolz_9functoolz_Compose *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_13__signature_____get__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self) { PyObject *__pyx_v_base = NULL; PyObject *__pyx_v_last = 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; __Pyx_RefNannySetupContext("__get__", 0); /* "cytoolz/functoolz.pyx":545 * property __signature__: * def __get__(self): * base = inspect.signature(self.first) # <<<<<<<<<<<<<< * last = inspect.signature(self.funcs[-1]) * return base.replace(return_annotation=last.return_annotation) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_inspect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_signature); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_self->first) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->first); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_base = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":546 * def __get__(self): * base = inspect.signature(self.first) * last = inspect.signature(self.funcs[-1]) # <<<<<<<<<<<<<< * return base.replace(return_annotation=last.return_annotation) * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_inspect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_signature); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_v_self->funcs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 546, __pyx_L1_error) } __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_self->funcs, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_last = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":547 * base = inspect.signature(self.first) * last = inspect.signature(self.funcs[-1]) * return base.replace(return_annotation=last.return_annotation) # <<<<<<<<<<<<<< * * property __name__: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_base, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_last, __pyx_n_s_return_annotation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return_annotation, __pyx_t_3) < 0) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __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; /* "cytoolz/functoolz.pyx":544 * * property __signature__: * def __get__(self): # <<<<<<<<<<<<<< * base = inspect.signature(self.first) * last = inspect.signature(self.funcs[-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("cytoolz.functoolz.Compose.__signature__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_base); __Pyx_XDECREF(__pyx_v_last); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":550 * * property __name__: * def __get__(self): # <<<<<<<<<<<<<< * try: * return '_of_'.join( */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_8__name___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_8__name___1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7Compose_8__name_____get__(((struct __pyx_obj_7cytoolz_9functoolz_Compose *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7cytoolz_9functoolz_7Compose_8__name___7__get___2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "cytoolz/functoolz.pyx":553 * try: * return '_of_'.join( * f.__name__ for f in reversed((self.first,) + self.funcs) # <<<<<<<<<<<<<< * ) * except AttributeError: */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_8__name___7__get___genexpr(PyObject *__pyx_self) { struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr *)__pyx_tp_new_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr(__pyx_ptype_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 553, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct____get__ *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7cytoolz_9functoolz_7Compose_8__name___7__get___2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Compose___get___locals_genexpr, __pyx_n_s_cytoolz_functoolz); if (unlikely(!gen)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("cytoolz.functoolz.Compose.__name__.__get__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7cytoolz_9functoolz_7Compose_8__name___7__get___2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7cytoolz_9functoolz___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; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 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_ERR(0, 553, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 553, __pyx_L1_error) } __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->first); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->first); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->first); if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 553, __pyx_L1_error) } __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->funcs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = PyTuple_GET_SIZE(__pyx_t_1) - 1; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (__pyx_t_3 < 0) break; if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 553, __pyx_L1_error) #else __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3--; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_f, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_f, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* 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_3 = __pyx_cur_scope->__pyx_t_1; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 553, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":550 * * property __name__: * def __get__(self): # <<<<<<<<<<<<<< * try: * return '_of_'.join( */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_8__name_____get__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self) { struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct____get__ *__pyx_cur_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; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __pyx_cur_scope = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct____get__ *)__pyx_tp_new_7cytoolz_9functoolz___pyx_scope_struct____get__(__pyx_ptype_7cytoolz_9functoolz___pyx_scope_struct____get__, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct____get__ *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 550, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); /* "cytoolz/functoolz.pyx":551 * property __name__: * def __get__(self): * try: # <<<<<<<<<<<<<< * return '_of_'.join( * f.__name__ for f in reversed((self.first,) + self.funcs) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __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:*/ { /* "cytoolz/functoolz.pyx":552 * def __get__(self): * try: * return '_of_'.join( # <<<<<<<<<<<<<< * f.__name__ for f in reversed((self.first,) + self.funcs) * ) */ __Pyx_XDECREF(__pyx_r); /* "cytoolz/functoolz.pyx":553 * try: * return '_of_'.join( * f.__name__ for f in reversed((self.first,) + self.funcs) # <<<<<<<<<<<<<< * ) * except AttributeError: */ __pyx_t_4 = __pyx_pf_7cytoolz_9functoolz_7Compose_8__name___7__get___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); /* "cytoolz/functoolz.pyx":552 * def __get__(self): * try: * return '_of_'.join( # <<<<<<<<<<<<<< * f.__name__ for f in reversed((self.first,) + self.funcs) * ) */ __pyx_t_5 = __Pyx_PyString_Join(__pyx_n_s_of, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 552, __pyx_L3_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_L7_try_return; /* "cytoolz/functoolz.pyx":551 * property __name__: * def __get__(self): * try: # <<<<<<<<<<<<<< * return '_of_'.join( * f.__name__ for f in reversed((self.first,) + self.funcs) */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "cytoolz/functoolz.pyx":555 * f.__name__ for f in reversed((self.first,) + self.funcs) * ) * except AttributeError: # <<<<<<<<<<<<<< * return type(self).__name__ * */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_6) { __Pyx_AddTraceback("cytoolz.functoolz.Compose.__name__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 555, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_7); /* "cytoolz/functoolz.pyx":556 * ) * except AttributeError: * return type(self).__name__ # <<<<<<<<<<<<<< * * property __doc__: */ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_cur_scope->__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 556, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __pyx_r = __pyx_t_8; __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "cytoolz/functoolz.pyx":551 * property __name__: * def __get__(self): * try: # <<<<<<<<<<<<<< * return '_of_'.join( * f.__name__ for f in reversed((self.first,) + self.funcs) */ __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; } /* "cytoolz/functoolz.pyx":550 * * property __name__: * def __get__(self): # <<<<<<<<<<<<<< * try: * return '_of_'.join( */ /* 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("cytoolz.functoolz.Compose.__name__.__get__", __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; } /* "cytoolz/functoolz.pyx":559 * * property __doc__: * def __get__(self): # <<<<<<<<<<<<<< * def composed_doc(*fs): * """Generate a docstring for the composition of fs. */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_7__doc___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_7__doc___1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7Compose_7__doc_____get__(((struct __pyx_obj_7cytoolz_9functoolz_Compose *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":560 * property __doc__: * def __get__(self): * def composed_doc(*fs): # <<<<<<<<<<<<<< * """Generate a docstring for the composition of fs. * """ */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_7__doc___7__get___1composed_doc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_7Compose_7__doc___7__get___composed_doc[] = "Generate a docstring for the composition of fs.\n "; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_7Compose_7__doc___7__get___1composed_doc = {"composed_doc", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9functoolz_7Compose_7__doc___7__get___1composed_doc, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9functoolz_7Compose_7__doc___7__get___composed_doc}; static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_7__doc___7__get___1composed_doc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_fs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("composed_doc (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "composed_doc", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_fs = __pyx_args; __pyx_r = __pyx_pf_7cytoolz_9functoolz_7Compose_7__doc___7__get___composed_doc(__pyx_self, __pyx_v_fs); /* function exit code */ __Pyx_XDECREF(__pyx_v_fs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_7__doc___7__get___composed_doc(PyObject *__pyx_self, PyObject *__pyx_v_fs) { struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_2___get__ *__pyx_cur_scope; struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_2___get__ *__pyx_outer_scope; 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; __Pyx_RefNannySetupContext("composed_doc", 0); __pyx_outer_scope = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_2___get__ *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; /* "cytoolz/functoolz.pyx":563 * """Generate a docstring for the composition of fs. * """ * if not fs: # <<<<<<<<<<<<<< * # Argument name for the docstring. * return '*args, **kwargs' */ __pyx_t_1 = (PyTuple_GET_SIZE(__pyx_v_fs) != 0); __pyx_t_2 = ((!__pyx_t_1) != 0); if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":565 * if not fs: * # Argument name for the docstring. * return '*args, **kwargs' # <<<<<<<<<<<<<< * * return '{f}({g})'.format(f=fs[0].__name__, g=composed_doc(*fs[1:])) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_s_args_kwargs); __pyx_r = __pyx_kp_s_args_kwargs; goto __pyx_L0; /* "cytoolz/functoolz.pyx":563 * """Generate a docstring for the composition of fs. * """ * if not fs: # <<<<<<<<<<<<<< * # Argument name for the docstring. * return '*args, **kwargs' */ } /* "cytoolz/functoolz.pyx":567 * return '*args, **kwargs' * * return '{f}({g})'.format(f=fs[0].__name__, g=composed_doc(*fs[1:])) # <<<<<<<<<<<<<< * * try: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_f_g, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v_fs, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 567, __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_f, __pyx_t_6) < 0) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_cur_scope->__pyx_v_composed_doc)) { __Pyx_RaiseClosureNameError("composed_doc"); __PYX_ERR(0, 567, __pyx_L1_error) } __pyx_t_6 = __Pyx_PyTuple_GetSlice(__pyx_v_fs, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_composed_doc, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_g, __pyx_t_5) < 0) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 567, __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_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":560 * property __doc__: * def __get__(self): * def composed_doc(*fs): # <<<<<<<<<<<<<< * """Generate a docstring for the composition of fs. * """ */ /* 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("cytoolz.functoolz.Compose.__doc__.__get__.composed_doc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":559 * * property __doc__: * def __get__(self): # <<<<<<<<<<<<<< * def composed_doc(*fs): * """Generate a docstring for the composition of fs. */ static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_7__doc_____get__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self) { struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_2___get__ *__pyx_cur_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; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("__get__", 0); __pyx_cur_scope = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_2___get__ *)__pyx_tp_new_7cytoolz_9functoolz___pyx_scope_struct_2___get__(__pyx_ptype_7cytoolz_9functoolz___pyx_scope_struct_2___get__, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_2___get__ *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 559, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } /* "cytoolz/functoolz.pyx":560 * property __doc__: * def __get__(self): * def composed_doc(*fs): # <<<<<<<<<<<<<< * """Generate a docstring for the composition of fs. * """ */ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_7Compose_7__doc___7__get___1composed_doc, 0, __pyx_n_s_Compose___get___locals_composed, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_v_composed_doc = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":569 * return '{f}({g})'.format(f=fs[0].__name__, g=composed_doc(*fs[1:])) * * try: # <<<<<<<<<<<<<< * return ( * 'lambda *args, **kwargs: ' + */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __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:*/ { /* "cytoolz/functoolz.pyx":570 * * try: * return ( # <<<<<<<<<<<<<< * 'lambda *args, **kwargs: ' + * composed_doc(*reversed((self.first,) + self.funcs)) */ __Pyx_XDECREF(__pyx_r); /* "cytoolz/functoolz.pyx":572 * return ( * 'lambda *args, **kwargs: ' + * composed_doc(*reversed((self.first,) + self.funcs)) # <<<<<<<<<<<<<< * ) * except AttributeError: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->first); __Pyx_GIVEREF(__pyx_v_self->first); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->first); __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_v_self->funcs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 572, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_reversed, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 572, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_composed_doc, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "cytoolz/functoolz.pyx":571 * try: * return ( * 'lambda *args, **kwargs: ' + # <<<<<<<<<<<<<< * composed_doc(*reversed((self.first,) + self.funcs)) * ) */ __pyx_t_5 = PyNumber_Add(__pyx_kp_s_lambda_args_kwargs, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L3_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_L7_try_return; /* "cytoolz/functoolz.pyx":569 * return '{f}({g})'.format(f=fs[0].__name__, g=composed_doc(*fs[1:])) * * try: # <<<<<<<<<<<<<< * return ( * 'lambda *args, **kwargs: ' + */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "cytoolz/functoolz.pyx":574 * composed_doc(*reversed((self.first,) + self.funcs)) * ) * except AttributeError: # <<<<<<<<<<<<<< * # One of our callables does not have a `__name__`, whatever. * return 'A composition of functions' */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_6) { __Pyx_AddTraceback("cytoolz.functoolz.Compose.__doc__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_7) < 0) __PYX_ERR(0, 574, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_7); /* "cytoolz/functoolz.pyx":576 * except AttributeError: * # One of our callables does not have a `__name__`, whatever. * return 'A composition of functions' # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_kp_s_A_composition_of_functions); __pyx_r = __pyx_kp_s_A_composition_of_functions; __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; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "cytoolz/functoolz.pyx":569 * return '{f}({g})'.format(f=fs[0].__name__, g=composed_doc(*fs[1:])) * * try: # <<<<<<<<<<<<<< * return ( * 'lambda *args, **kwargs: ' + */ __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_try_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_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; } /* "cytoolz/functoolz.pyx":559 * * property __doc__: * def __get__(self): # <<<<<<<<<<<<<< * def composed_doc(*fs): * """Generate a docstring for the composition of fs. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("cytoolz.functoolz.Compose.__doc__.__get__", __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; } /* "cytoolz/functoolz.pxd":34 * * cdef class Compose: * cdef public object first # <<<<<<<<<<<<<< * cdef public tuple funcs * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_5first_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_5first_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7Compose_5first___get__(((struct __pyx_obj_7cytoolz_9functoolz_Compose *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_5first___get__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->first); __pyx_r = __pyx_v_self->first; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_7Compose_5first_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_7Compose_5first_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7Compose_5first_2__set__(((struct __pyx_obj_7cytoolz_9functoolz_Compose *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_7Compose_5first_2__set__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__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->first); __Pyx_DECREF(__pyx_v_self->first); __pyx_v_self->first = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_7Compose_5first_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_7Compose_5first_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7Compose_5first_4__del__(((struct __pyx_obj_7cytoolz_9functoolz_Compose *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_7Compose_5first_4__del__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__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->first); __Pyx_DECREF(__pyx_v_self->first); __pyx_v_self->first = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pxd":35 * cdef class Compose: * cdef public object first * cdef public tuple funcs # <<<<<<<<<<<<<< * * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_5funcs_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_7Compose_5funcs_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7Compose_5funcs___get__(((struct __pyx_obj_7cytoolz_9functoolz_Compose *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_7Compose_5funcs___get__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->funcs); __pyx_r = __pyx_v_self->funcs; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_7Compose_5funcs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_7Compose_5funcs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7Compose_5funcs_2__set__(((struct __pyx_obj_7cytoolz_9functoolz_Compose *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_7Compose_5funcs_2__set__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__set__", 0); if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 35, __pyx_L1_error) __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->funcs); __Pyx_DECREF(__pyx_v_self->funcs); __pyx_v_self->funcs = ((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("cytoolz.functoolz.Compose.funcs.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_7Compose_5funcs_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_7Compose_5funcs_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7Compose_5funcs_4__del__(((struct __pyx_obj_7cytoolz_9functoolz_Compose *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_7Compose_5funcs_4__del__(struct __pyx_obj_7cytoolz_9functoolz_Compose *__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->funcs); __Pyx_DECREF(__pyx_v_self->funcs); __pyx_v_self->funcs = ((PyObject*)Py_None); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":579 * * * cdef object c_compose(object funcs): # <<<<<<<<<<<<<< * if not funcs: * return identity */ static PyObject *__pyx_f_7cytoolz_9functoolz_c_compose(PyObject *__pyx_v_funcs) { 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; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("c_compose", 0); /* "cytoolz/functoolz.pyx":580 * * cdef object c_compose(object funcs): * if not funcs: # <<<<<<<<<<<<<< * return identity * elif len(funcs) == 1: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_funcs); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 580, __pyx_L1_error) __pyx_t_2 = ((!__pyx_t_1) != 0); if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":581 * cdef object c_compose(object funcs): * if not funcs: * return identity # <<<<<<<<<<<<<< * elif len(funcs) == 1: * return funcs[0] */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_identity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":580 * * cdef object c_compose(object funcs): * if not funcs: # <<<<<<<<<<<<<< * return identity * elif len(funcs) == 1: */ } /* "cytoolz/functoolz.pyx":582 * if not funcs: * return identity * elif len(funcs) == 1: # <<<<<<<<<<<<<< * return funcs[0] * else: */ __pyx_t_4 = PyObject_Length(__pyx_v_funcs); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 582, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_4 == 1) != 0); if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":583 * return identity * elif len(funcs) == 1: * return funcs[0] # <<<<<<<<<<<<<< * else: * return Compose(*funcs) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_funcs, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":582 * if not funcs: * return identity * elif len(funcs) == 1: # <<<<<<<<<<<<<< * return funcs[0] * else: */ } /* "cytoolz/functoolz.pyx":585 * return funcs[0] * else: * return Compose(*funcs) # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_funcs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9functoolz_Compose), __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 585, __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; } /* "cytoolz/functoolz.pyx":579 * * * cdef object c_compose(object funcs): # <<<<<<<<<<<<<< * if not funcs: * return identity */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("cytoolz.functoolz.c_compose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":588 * * * def compose(*funcs): # <<<<<<<<<<<<<< * """ * Compose functions to operate in series. */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_13compose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_12compose[] = "compose(*funcs)\n\n Compose functions to operate in series.\n\n Returns a function that applies other functions in sequence.\n\n Functions are applied from right to left so that\n ``compose(f, g, h)(x, y)`` is the same as ``f(g(h(x, y)))``.\n\n If no arguments are provided, the identity function (f(x) = x) is returned.\n\n >>> inc = lambda i: i + 1\n >>> compose(str, inc)(3)\n '4'\n\n See Also:\n compose_left\n pipe\n "; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_13compose = {"compose", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9functoolz_13compose, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9functoolz_12compose}; static PyObject *__pyx_pw_7cytoolz_9functoolz_13compose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_funcs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("compose (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "compose", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_funcs = __pyx_args; __pyx_r = __pyx_pf_7cytoolz_9functoolz_12compose(__pyx_self, __pyx_v_funcs); /* function exit code */ __Pyx_XDECREF(__pyx_v_funcs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_12compose(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_funcs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("compose", 0); /* "cytoolz/functoolz.pyx":607 * pipe * """ * return c_compose(funcs) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9functoolz_c_compose(__pyx_v_funcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":588 * * * def compose(*funcs): # <<<<<<<<<<<<<< * """ * Compose functions to operate in series. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.functoolz.compose", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":610 * * * cdef object c_compose_left(object funcs): # <<<<<<<<<<<<<< * if not funcs: * return identity */ static PyObject *__pyx_f_7cytoolz_9functoolz_c_compose_left(PyObject *__pyx_v_funcs) { 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; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("c_compose_left", 0); /* "cytoolz/functoolz.pyx":611 * * cdef object c_compose_left(object funcs): * if not funcs: # <<<<<<<<<<<<<< * return identity * elif len(funcs) == 1: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_funcs); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 611, __pyx_L1_error) __pyx_t_2 = ((!__pyx_t_1) != 0); if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":612 * cdef object c_compose_left(object funcs): * if not funcs: * return identity # <<<<<<<<<<<<<< * elif len(funcs) == 1: * return funcs[0] */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_identity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":611 * * cdef object c_compose_left(object funcs): * if not funcs: # <<<<<<<<<<<<<< * return identity * elif len(funcs) == 1: */ } /* "cytoolz/functoolz.pyx":613 * if not funcs: * return identity * elif len(funcs) == 1: # <<<<<<<<<<<<<< * return funcs[0] * else: */ __pyx_t_4 = PyObject_Length(__pyx_v_funcs); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 613, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_4 == 1) != 0); if (__pyx_t_2) { /* "cytoolz/functoolz.pyx":614 * return identity * elif len(funcs) == 1: * return funcs[0] # <<<<<<<<<<<<<< * else: * return Compose(*reversed(funcs)) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_funcs, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":613 * if not funcs: * return identity * elif len(funcs) == 1: # <<<<<<<<<<<<<< * return funcs[0] * else: */ } /* "cytoolz/functoolz.pyx":616 * return funcs[0] * else: * return Compose(*reversed(funcs)) # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_reversed, __pyx_v_funcs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9functoolz_Compose), __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "cytoolz/functoolz.pyx":610 * * * cdef object c_compose_left(object funcs): # <<<<<<<<<<<<<< * if not funcs: * return identity */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("cytoolz.functoolz.c_compose_left", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":619 * * * def compose_left(*funcs): # <<<<<<<<<<<<<< * """ * Compose functions to operate in series. */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_15compose_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_14compose_left[] = "compose_left(*funcs)\n\n Compose functions to operate in series.\n\n Returns a function that applies other functions in sequence.\n\n Functions are applied from left to right so that\n ``compose_left(f, g, h)(x, y)`` is the same as ``h(g(f(x, y)))``.\n\n If no arguments are provided, the identity function (f(x) = x) is returned.\n\n >>> inc = lambda i: i + 1\n >>> compose_left(inc, str)(3)\n '4'\n\n See Also:\n compose\n pipe\n "; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_15compose_left = {"compose_left", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9functoolz_15compose_left, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9functoolz_14compose_left}; static PyObject *__pyx_pw_7cytoolz_9functoolz_15compose_left(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_funcs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("compose_left (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "compose_left", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_funcs = __pyx_args; __pyx_r = __pyx_pf_7cytoolz_9functoolz_14compose_left(__pyx_self, __pyx_v_funcs); /* function exit code */ __Pyx_XDECREF(__pyx_v_funcs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_14compose_left(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_funcs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("compose_left", 0); /* "cytoolz/functoolz.pyx":638 * pipe * """ * return c_compose_left(funcs) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9functoolz_c_compose_left(__pyx_v_funcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":619 * * * def compose_left(*funcs): # <<<<<<<<<<<<<< * """ * Compose functions to operate in series. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.functoolz.compose_left", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":641 * * * cdef object c_pipe(object data, object funcs): # <<<<<<<<<<<<<< * cdef object func * for func in funcs: */ static PyObject *__pyx_f_7cytoolz_9functoolz_c_pipe(PyObject *__pyx_v_data, PyObject *__pyx_v_funcs) { PyObject *__pyx_v_func = 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; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; __Pyx_RefNannySetupContext("c_pipe", 0); __Pyx_INCREF(__pyx_v_data); /* "cytoolz/functoolz.pyx":643 * cdef object c_pipe(object data, object funcs): * cdef object func * for func in funcs: # <<<<<<<<<<<<<< * data = func(data) * return data */ if (likely(PyList_CheckExact(__pyx_v_funcs)) || PyTuple_CheckExact(__pyx_v_funcs)) { __pyx_t_1 = __pyx_v_funcs; __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_funcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 643, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 643, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 643, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_func, __pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/functoolz.pyx":644 * cdef object func * for func in funcs: * data = func(data) # <<<<<<<<<<<<<< * return data * */ __Pyx_INCREF(__pyx_v_func); __pyx_t_5 = __pyx_v_func; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_data); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 644, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/functoolz.pyx":643 * cdef object c_pipe(object data, object funcs): * cdef object func * for func in funcs: # <<<<<<<<<<<<<< * data = func(data) * return data */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":645 * for func in funcs: * data = func(data) * return data # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_data); __pyx_r = __pyx_v_data; goto __pyx_L0; /* "cytoolz/functoolz.pyx":641 * * * cdef object c_pipe(object data, object funcs): # <<<<<<<<<<<<<< * cdef object func * for func in funcs: */ /* 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("cytoolz.functoolz.c_pipe", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_func); __Pyx_XDECREF(__pyx_v_data); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":648 * * * def pipe(data, *funcs): # <<<<<<<<<<<<<< * """ * Pipe a value through a sequence of functions */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_17pipe(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_16pipe[] = "pipe(data, *funcs)\n\n Pipe a value through a sequence of functions\n\n I.e. ``pipe(data, f, g, h)`` is equivalent to ``h(g(f(data)))``\n\n We think of the value as progressing through a pipe of several\n transformations, much like pipes in UNIX\n\n ``$ cat data | f | g | h``\n\n >>> double = lambda i: 2 * i\n >>> pipe(3, double, str)\n '6'\n\n See Also:\n compose\n compose_left\n thread_first\n thread_last\n "; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_17pipe = {"pipe", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9functoolz_17pipe, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9functoolz_16pipe}; static PyObject *__pyx_pw_7cytoolz_9functoolz_17pipe(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_data = 0; PyObject *__pyx_v_funcs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pipe (wrapper)", 0); if (PyTuple_GET_SIZE(__pyx_args) > 1) { __pyx_v_funcs = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); if (unlikely(!__pyx_v_funcs)) { __Pyx_RefNannyFinishContext(); return NULL; } __Pyx_GOTREF(__pyx_v_funcs); } else { __pyx_v_funcs = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,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) { default: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "pipe") < 0)) __PYX_ERR(0, 648, __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_data = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pipe", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 648, __pyx_L3_error) __pyx_L3_error:; __Pyx_DECREF(__pyx_v_funcs); __pyx_v_funcs = 0; __Pyx_AddTraceback("cytoolz.functoolz.pipe", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9functoolz_16pipe(__pyx_self, __pyx_v_data, __pyx_v_funcs); /* function exit code */ __Pyx_XDECREF(__pyx_v_funcs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_16pipe(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_funcs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("pipe", 0); /* "cytoolz/functoolz.pyx":669 * thread_last * """ * return c_pipe(data, funcs) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9functoolz_c_pipe(__pyx_v_data, __pyx_v_funcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":648 * * * def pipe(data, *funcs): # <<<<<<<<<<<<<< * """ * Pipe a value through a sequence of functions */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.functoolz.pipe", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":687 * False * """ * def __cinit__(self, func): # <<<<<<<<<<<<<< * self.func = func * */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_10complement_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_10complement_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_func = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,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); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 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, "__cinit__") < 0)) __PYX_ERR(0, 687, __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_func = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 687, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.functoolz.complement.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9functoolz_10complement___cinit__(((struct __pyx_obj_7cytoolz_9functoolz_complement *)__pyx_v_self), __pyx_v_func); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_10complement___cinit__(struct __pyx_obj_7cytoolz_9functoolz_complement *__pyx_v_self, PyObject *__pyx_v_func) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/functoolz.pyx":688 * """ * def __cinit__(self, func): * self.func = func # <<<<<<<<<<<<<< * * def __call__(self, *args, **kwargs): */ __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; /* "cytoolz/functoolz.pyx":687 * False * """ * def __cinit__(self, func): # <<<<<<<<<<<<<< * self.func = func * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":690 * self.func = func * * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< * return not PyObject_Call(self.func, args, kwargs) # use PyObject_Not? * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_10complement_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_10complement_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 1))) return NULL; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_7cytoolz_9functoolz_10complement_2__call__(((struct __pyx_obj_7cytoolz_9functoolz_complement *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_10complement_2__call__(struct __pyx_obj_7cytoolz_9functoolz_complement *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; __Pyx_RefNannySetupContext("__call__", 0); /* "cytoolz/functoolz.pyx":691 * * def __call__(self, *args, **kwargs): * return not PyObject_Call(self.func, args, kwargs) # use PyObject_Not? # <<<<<<<<<<<<<< * * def __reduce__(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_v_self->func; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __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_ERR(0, 691, __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_ERR(0, 691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":690 * self.func = func * * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< * return not PyObject_Call(self.func, args, kwargs) # use PyObject_Not? * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.functoolz.complement.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":693 * return not PyObject_Call(self.func, args, kwargs) # use PyObject_Not? * * def __reduce__(self): # <<<<<<<<<<<<<< * return (complement, (self.func,)) * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_10complement_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_10complement_4__reduce__[] = "complement.__reduce__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_10complement_5__reduce__ = {"__reduce__", (PyCFunction)__pyx_pw_7cytoolz_9functoolz_10complement_5__reduce__, METH_NOARGS, __pyx_doc_7cytoolz_9functoolz_10complement_4__reduce__}; static PyObject *__pyx_pw_7cytoolz_9functoolz_10complement_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_10complement_4__reduce__(((struct __pyx_obj_7cytoolz_9functoolz_complement *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_10complement_4__reduce__(struct __pyx_obj_7cytoolz_9functoolz_complement *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__reduce__", 0); /* "cytoolz/functoolz.pyx":694 * * def __reduce__(self): * return (complement, (self.func,)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->func); __Pyx_GIVEREF(__pyx_v_self->func); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->func); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_ptype_7cytoolz_9functoolz_complement)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7cytoolz_9functoolz_complement)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_7cytoolz_9functoolz_complement)); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":693 * return not PyObject_Call(self.func, args, kwargs) # use PyObject_Not? * * def __reduce__(self): # <<<<<<<<<<<<<< * return (complement, (self.func,)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.functoolz.complement.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":698 * * cdef class _juxt_inner: * def __cinit__(self, funcs): # <<<<<<<<<<<<<< * self.funcs = tuple(funcs) * */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_11_juxt_inner_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_11_juxt_inner_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_funcs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_funcs,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); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_funcs)) != 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, "__cinit__") < 0)) __PYX_ERR(0, 698, __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_funcs = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 698, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.functoolz._juxt_inner.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9functoolz_11_juxt_inner___cinit__(((struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *)__pyx_v_self), __pyx_v_funcs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_11_juxt_inner___cinit__(struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *__pyx_v_self, PyObject *__pyx_v_funcs) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/functoolz.pyx":699 * cdef class _juxt_inner: * def __cinit__(self, funcs): * self.funcs = tuple(funcs) # <<<<<<<<<<<<<< * * def __call__(self, *args, **kwargs): */ __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_funcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 699, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->funcs); __Pyx_DECREF(__pyx_v_self->funcs); __pyx_v_self->funcs = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":698 * * cdef class _juxt_inner: * def __cinit__(self, funcs): # <<<<<<<<<<<<<< * self.funcs = tuple(funcs) * */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.functoolz._juxt_inner.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":701 * self.funcs = tuple(funcs) * * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< * if kwargs: * return tuple(PyObject_Call(func, args, kwargs) for func in self.funcs) */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_11_juxt_inner_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_11_juxt_inner_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 1))) return NULL; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_7cytoolz_9functoolz_11_juxt_inner_2__call__(((struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7cytoolz_9functoolz_11_juxt_inner_8__call___2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "cytoolz/functoolz.pyx":703 * def __call__(self, *args, **kwargs): * if kwargs: * return tuple(PyObject_Call(func, args, kwargs) for func in self.funcs) # <<<<<<<<<<<<<< * else: * return tuple(PyObject_CallObject(func, args) for func in self.funcs) */ static PyObject *__pyx_pf_7cytoolz_9functoolz_11_juxt_inner_8__call___genexpr(PyObject *__pyx_self) { struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr *)__pyx_tp_new_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr(__pyx_ptype_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 703, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_3___call__ *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7cytoolz_9functoolz_11_juxt_inner_8__call___2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_call___locals_genexpr, __pyx_n_s_cytoolz_functoolz); if (unlikely(!gen)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("cytoolz.functoolz._juxt_inner.__call__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7cytoolz_9functoolz_11_juxt_inner_8__call___2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; 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; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 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_ERR(0, 703, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 703, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->funcs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 703, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->funcs; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 703, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_func); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_func, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) { __Pyx_RaiseClosureNameError("args"); __PYX_ERR(0, 703, __pyx_L1_error) } __pyx_t_3 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_args; __Pyx_INCREF(__pyx_t_3); if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs)) { __Pyx_RaiseClosureNameError("kwargs"); __PYX_ERR(0, 703, __pyx_L1_error) } __pyx_t_4 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_kwargs; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __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_r = __pyx_t_5; __pyx_t_5 = 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_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* 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; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 703, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __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("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7cytoolz_9functoolz_11_juxt_inner_8__call___5generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ /* "cytoolz/functoolz.pyx":705 * return tuple(PyObject_Call(func, args, kwargs) for func in self.funcs) * else: * return tuple(PyObject_CallObject(func, args) for func in self.funcs) # <<<<<<<<<<<<<< * * def __reduce__(self): */ static PyObject *__pyx_pf_7cytoolz_9functoolz_11_juxt_inner_8__call___3genexpr(PyObject *__pyx_self) { struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 0); __pyx_cur_scope = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr *)__pyx_tp_new_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr(__pyx_ptype_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 705, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_3___call__ *) __pyx_self; __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope)); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope); { __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7cytoolz_9functoolz_11_juxt_inner_8__call___5generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_call___locals_genexpr, __pyx_n_s_cytoolz_functoolz); if (unlikely(!gen)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; } /* function exit code */ __pyx_L1_error:; __Pyx_AddTraceback("cytoolz.functoolz._juxt_inner.__call__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF(((PyObject *)__pyx_cur_scope)); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_gb_7cytoolz_9functoolz_11_juxt_inner_8__call___5generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("genexpr", 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_ERR(0, 705, __pyx_L1_error) if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 705, __pyx_L1_error) } if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->funcs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 705, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->funcs; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 705, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_func); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_func, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_args)) { __Pyx_RaiseClosureNameError("args"); __PYX_ERR(0, 705, __pyx_L1_error) } __pyx_t_3 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_args; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = PyObject_CallObject(__pyx_cur_scope->__pyx_v_func, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 705, __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; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); /* 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; if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 705, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; #if !CYTHON_USE_EXC_INFO_STACK __Pyx_Coroutine_ResetAndClearException(__pyx_generator); #endif __pyx_generator->resume_label = -1; __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":701 * self.funcs = tuple(funcs) * * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< * if kwargs: * return tuple(PyObject_Call(func, args, kwargs) for func in self.funcs) */ static PyObject *__pyx_pf_7cytoolz_9functoolz_11_juxt_inner_2__call__(struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_3___call__ *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__call__", 0); __pyx_cur_scope = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_3___call__ *)__pyx_tp_new_7cytoolz_9functoolz___pyx_scope_struct_3___call__(__pyx_ptype_7cytoolz_9functoolz___pyx_scope_struct_3___call__, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_3___call__ *)Py_None); __Pyx_INCREF(Py_None); __PYX_ERR(0, 701, __pyx_L1_error) } else { __Pyx_GOTREF(__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_self = __pyx_v_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self); __pyx_cur_scope->__pyx_v_args = __pyx_v_args; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args); __pyx_cur_scope->__pyx_v_kwargs = __pyx_v_kwargs; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_kwargs); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_kwargs); /* "cytoolz/functoolz.pyx":702 * * def __call__(self, *args, **kwargs): * if kwargs: # <<<<<<<<<<<<<< * return tuple(PyObject_Call(func, args, kwargs) for func in self.funcs) * else: */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_kwargs); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 702, __pyx_L1_error) if (__pyx_t_1) { /* "cytoolz/functoolz.pyx":703 * def __call__(self, *args, **kwargs): * if kwargs: * return tuple(PyObject_Call(func, args, kwargs) for func in self.funcs) # <<<<<<<<<<<<<< * else: * return tuple(PyObject_CallObject(func, args) for func in self.funcs) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_pf_7cytoolz_9functoolz_11_juxt_inner_8__call___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 703, __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; /* "cytoolz/functoolz.pyx":702 * * def __call__(self, *args, **kwargs): * if kwargs: # <<<<<<<<<<<<<< * return tuple(PyObject_Call(func, args, kwargs) for func in self.funcs) * else: */ } /* "cytoolz/functoolz.pyx":705 * return tuple(PyObject_Call(func, args, kwargs) for func in self.funcs) * else: * return tuple(PyObject_CallObject(func, args) for func in self.funcs) # <<<<<<<<<<<<<< * * def __reduce__(self): */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_pf_7cytoolz_9functoolz_11_juxt_inner_8__call___3genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __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; } /* "cytoolz/functoolz.pyx":701 * self.funcs = tuple(funcs) * * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< * if kwargs: * return tuple(PyObject_Call(func, args, kwargs) for func in self.funcs) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.functoolz._juxt_inner.__call__", __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; } /* "cytoolz/functoolz.pyx":707 * return tuple(PyObject_CallObject(func, args) for func in self.funcs) * * def __reduce__(self): # <<<<<<<<<<<<<< * return (_juxt_inner, (self.funcs,)) * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_11_juxt_inner_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_11_juxt_inner_4__reduce__[] = "_juxt_inner.__reduce__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_11_juxt_inner_5__reduce__ = {"__reduce__", (PyCFunction)__pyx_pw_7cytoolz_9functoolz_11_juxt_inner_5__reduce__, METH_NOARGS, __pyx_doc_7cytoolz_9functoolz_11_juxt_inner_4__reduce__}; static PyObject *__pyx_pw_7cytoolz_9functoolz_11_juxt_inner_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_11_juxt_inner_4__reduce__(((struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_11_juxt_inner_4__reduce__(struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__reduce__", 0); /* "cytoolz/functoolz.pyx":708 * * def __reduce__(self): * return (_juxt_inner, (self.funcs,)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->funcs); __Pyx_GIVEREF(__pyx_v_self->funcs); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->funcs); __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(((PyObject *)__pyx_ptype_7cytoolz_9functoolz__juxt_inner)); __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7cytoolz_9functoolz__juxt_inner)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_7cytoolz_9functoolz__juxt_inner)); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":707 * return tuple(PyObject_CallObject(func, args) for func in self.funcs) * * def __reduce__(self): # <<<<<<<<<<<<<< * return (_juxt_inner, (self.funcs,)) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.functoolz._juxt_inner.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pxd":52 * * cdef class _juxt_inner: * cdef public tuple funcs # <<<<<<<<<<<<<< * * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_11_juxt_inner_5funcs_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_11_juxt_inner_5funcs_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_11_juxt_inner_5funcs___get__(((struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_11_juxt_inner_5funcs___get__(struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->funcs); __pyx_r = __pyx_v_self->funcs; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_11_juxt_inner_5funcs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_11_juxt_inner_5funcs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_11_juxt_inner_5funcs_2__set__(((struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_11_juxt_inner_5funcs_2__set__(struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__set__", 0); if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 52, __pyx_L1_error) __pyx_t_1 = __pyx_v_value; __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->funcs); __Pyx_DECREF(__pyx_v_self->funcs); __pyx_v_self->funcs = ((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("cytoolz.functoolz._juxt_inner.funcs.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_11_juxt_inner_5funcs_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_11_juxt_inner_5funcs_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_11_juxt_inner_5funcs_4__del__(((struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_11_juxt_inner_5funcs_4__del__(struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *__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->funcs); __Pyx_DECREF(__pyx_v_self->funcs); __pyx_v_self->funcs = ((PyObject*)Py_None); /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":711 * * * cdef object c_juxt(object funcs): # <<<<<<<<<<<<<< * return _juxt_inner(funcs) * */ static PyObject *__pyx_f_7cytoolz_9functoolz_c_juxt(PyObject *__pyx_v_funcs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("c_juxt", 0); /* "cytoolz/functoolz.pyx":712 * * cdef object c_juxt(object funcs): * return _juxt_inner(funcs) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7cytoolz_9functoolz__juxt_inner), __pyx_v_funcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":711 * * * cdef object c_juxt(object funcs): # <<<<<<<<<<<<<< * return _juxt_inner(funcs) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.functoolz.c_juxt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":715 * * * def juxt(*funcs): # <<<<<<<<<<<<<< * """ * Creates a function that calls several functions with the same arguments */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_19juxt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_18juxt[] = "juxt(*funcs)\n\n Creates a function that calls several functions with the same arguments\n\n Takes several functions and returns a function that applies its arguments\n to each of those functions then returns a tuple of the results.\n\n Name comes from juxtaposition: the fact of two things being seen or placed\n close together with contrasting effect.\n\n >>> inc = lambda x: x + 1\n >>> double = lambda x: x * 2\n >>> juxt(inc, double)(10)\n (11, 20)\n >>> juxt([inc, double])(10)\n (11, 20)\n "; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_19juxt = {"juxt", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9functoolz_19juxt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9functoolz_18juxt}; static PyObject *__pyx_pw_7cytoolz_9functoolz_19juxt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_funcs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("juxt (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "juxt", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_funcs = __pyx_args; __pyx_r = __pyx_pf_7cytoolz_9functoolz_18juxt(__pyx_self, __pyx_v_funcs); /* function exit code */ __Pyx_XDECREF(__pyx_v_funcs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_18juxt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_funcs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; Py_ssize_t __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("juxt", 0); __Pyx_INCREF(__pyx_v_funcs); /* "cytoolz/functoolz.pyx":732 * (11, 20) * """ * if len(funcs) == 1 and not PyCallable_Check(funcs[0]): # <<<<<<<<<<<<<< * funcs = funcs[0] * return c_juxt(funcs) */ __pyx_t_2 = PyObject_Length(__pyx_v_funcs); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 732, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_2 == 1) != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_funcs, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = ((!(PyCallable_Check(__pyx_t_4) != 0)) != 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "cytoolz/functoolz.pyx":733 * """ * if len(funcs) == 1 and not PyCallable_Check(funcs[0]): * funcs = funcs[0] # <<<<<<<<<<<<<< * return c_juxt(funcs) * */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_funcs, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_funcs, __pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/functoolz.pyx":732 * (11, 20) * """ * if len(funcs) == 1 and not PyCallable_Check(funcs[0]): # <<<<<<<<<<<<<< * funcs = funcs[0] * return c_juxt(funcs) */ } /* "cytoolz/functoolz.pyx":734 * if len(funcs) == 1 and not PyCallable_Check(funcs[0]): * funcs = funcs[0] * return c_juxt(funcs) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_7cytoolz_9functoolz_c_juxt(__pyx_v_funcs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "cytoolz/functoolz.pyx":715 * * * def juxt(*funcs): # <<<<<<<<<<<<<< * """ * Creates a function that calls several functions with the same arguments */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("cytoolz.functoolz.juxt", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_funcs); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":737 * * * cpdef object do(object func, object x): # <<<<<<<<<<<<<< * """ * Runs ``func`` on ``x``, returns ``x`` */ static PyObject *__pyx_pw_7cytoolz_9functoolz_21do(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9functoolz_do(PyObject *__pyx_v_func, PyObject *__pyx_v_x, 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; __Pyx_RefNannySetupContext("do", 0); /* "cytoolz/functoolz.pyx":760 * [1, 11] * """ * func(x) # <<<<<<<<<<<<<< * return x * */ __Pyx_INCREF(__pyx_v_func); __pyx_t_2 = __pyx_v_func; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_x); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __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; /* "cytoolz/functoolz.pyx":761 * """ * func(x) * return x # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_x); __pyx_r = __pyx_v_x; goto __pyx_L0; /* "cytoolz/functoolz.pyx":737 * * * cpdef object do(object func, object x): # <<<<<<<<<<<<<< * """ * Runs ``func`` on ``x``, returns ``x`` */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.functoolz.do", __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_7cytoolz_9functoolz_21do(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_20do[] = "do(func, x)\n\n Runs ``func`` on ``x``, returns ``x``\n\n Because the results of ``func`` are not returned, only the side\n effects of ``func`` are relevant.\n\n Logging functions can be made by composing ``do`` with a storage function\n like ``list.append`` or ``file.write``\n\n >>> from cytoolz import compose\n >>> from cytoolz.curried import do\n\n >>> log = []\n >>> inc = lambda x: x + 1\n >>> inc = compose(inc, do(log.append))\n >>> inc(1)\n 2\n >>> inc(11)\n 12\n >>> log\n [1, 11]\n "; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_21do = {"do", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9functoolz_21do, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9functoolz_20do}; static PyObject *__pyx_pw_7cytoolz_9functoolz_21do(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_func = 0; PyObject *__pyx_v_x = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("do (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_x,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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("do", 1, 2, 2, 1); __PYX_ERR(0, 737, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "do") < 0)) __PYX_ERR(0, 737, __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_func = values[0]; __pyx_v_x = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("do", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 737, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.functoolz.do", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9functoolz_20do(__pyx_self, __pyx_v_func, __pyx_v_x); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_20do(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("do", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9functoolz_do(__pyx_v_func, __pyx_v_x, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.functoolz.do", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":764 * * * cpdef object flip(object func, object a, object b): # <<<<<<<<<<<<<< * """ * Call the function call with the arguments flipped */ static PyObject *__pyx_pw_7cytoolz_9functoolz_23flip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9functoolz_flip(PyObject *__pyx_v_func, PyObject *__pyx_v_a, PyObject *__pyx_v_b, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("flip", 0); /* "cytoolz/functoolz.pyx":788 * [1, 2, 3] * """ * return PyObject_CallObject(func, (b, a)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_b); __Pyx_GIVEREF(__pyx_v_b); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_b); __Pyx_INCREF(__pyx_v_a); __Pyx_GIVEREF(__pyx_v_a); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_a); __pyx_t_2 = PyObject_CallObject(__pyx_v_func, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 788, __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; /* "cytoolz/functoolz.pyx":764 * * * cpdef object flip(object func, object a, object b): # <<<<<<<<<<<<<< * """ * Call the function call with the arguments flipped */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.functoolz.flip", __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_7cytoolz_9functoolz_23flip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_22flip[] = "flip(func, a, b)\n\n Call the function call with the arguments flipped\n\n This function is curried.\n\n >>> def div(a, b):\n ... return a // b\n ...\n >>> flip(div, 2, 6)\n 3\n >>> div_by_two = flip(div, 2)\n >>> div_by_two(4)\n 2\n\n This is particularly useful for built in functions and functions defined\n in C extensions that accept positional only arguments. For example:\n isinstance, issubclass.\n\n >>> data = [1, 'a', 'b', 2, 1.5, object(), 3]\n >>> only_ints = list(filter(flip(isinstance, int), data))\n >>> only_ints\n [1, 2, 3]\n "; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_23flip = {"flip", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9functoolz_23flip, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9functoolz_22flip}; static PyObject *__pyx_pw_7cytoolz_9functoolz_23flip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_func = 0; PyObject *__pyx_v_a = 0; PyObject *__pyx_v_b = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("flip (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_a,&__pyx_n_s_b,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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("flip", 1, 3, 3, 1); __PYX_ERR(0, 764, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("flip", 1, 3, 3, 2); __PYX_ERR(0, 764, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "flip") < 0)) __PYX_ERR(0, 764, __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_func = values[0]; __pyx_v_a = values[1]; __pyx_v_b = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("flip", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 764, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.functoolz.flip", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9functoolz_22flip(__pyx_self, __pyx_v_func, __pyx_v_a, __pyx_v_b); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_22flip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_a, PyObject *__pyx_v_b) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("flip", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9functoolz_flip(__pyx_v_func, __pyx_v_a, __pyx_v_b, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.functoolz.flip", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":794 * * * cpdef object return_none(object exc): # <<<<<<<<<<<<<< * """ * Returns None. */ static PyObject *__pyx_pw_7cytoolz_9functoolz_25return_none(PyObject *__pyx_self, PyObject *__pyx_v_exc); /*proto*/ static PyObject *__pyx_f_7cytoolz_9functoolz_return_none(CYTHON_UNUSED PyObject *__pyx_v_exc, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("return_none", 0); /* "cytoolz/functoolz.pyx":798 * Returns None. * """ * return None # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; /* "cytoolz/functoolz.pyx":794 * * * cpdef object return_none(object exc): # <<<<<<<<<<<<<< * """ * Returns None. */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_25return_none(PyObject *__pyx_self, PyObject *__pyx_v_exc); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_24return_none[] = "return_none(exc)\n\n Returns None.\n "; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_25return_none = {"return_none", (PyCFunction)__pyx_pw_7cytoolz_9functoolz_25return_none, METH_O, __pyx_doc_7cytoolz_9functoolz_24return_none}; static PyObject *__pyx_pw_7cytoolz_9functoolz_25return_none(PyObject *__pyx_self, PyObject *__pyx_v_exc) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("return_none (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_24return_none(__pyx_self, ((PyObject *)__pyx_v_exc)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_24return_none(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_exc) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("return_none", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9functoolz_return_none(__pyx_v_exc, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.functoolz.return_none", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":831 * """ * * def __init__(self, exc, func, handler=return_none): # <<<<<<<<<<<<<< * self.exc = exc * self.func = func */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_7excepts_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_7excepts_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_exc = 0; PyObject *__pyx_v_func = 0; PyObject *__pyx_v_handler = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc,&__pyx_n_s_func,&__pyx_n_s_handler,0}; PyObject* values[3] = {0,0,0}; values[2] = __pyx_k__13; 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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 831, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_handler); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 831, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; 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_exc = values[0]; __pyx_v_func = values[1]; __pyx_v_handler = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 831, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.functoolz.excepts.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9functoolz_7excepts___init__(((struct __pyx_obj_7cytoolz_9functoolz_excepts *)__pyx_v_self), __pyx_v_exc, __pyx_v_func, __pyx_v_handler); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_7excepts___init__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self, PyObject *__pyx_v_exc, PyObject *__pyx_v_func, PyObject *__pyx_v_handler) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__init__", 0); /* "cytoolz/functoolz.pyx":832 * * def __init__(self, exc, func, handler=return_none): * self.exc = exc # <<<<<<<<<<<<<< * self.func = func * self.handler = handler */ __Pyx_INCREF(__pyx_v_exc); __Pyx_GIVEREF(__pyx_v_exc); __Pyx_GOTREF(__pyx_v_self->exc); __Pyx_DECREF(__pyx_v_self->exc); __pyx_v_self->exc = __pyx_v_exc; /* "cytoolz/functoolz.pyx":833 * def __init__(self, exc, func, handler=return_none): * self.exc = exc * self.func = func # <<<<<<<<<<<<<< * self.handler = handler * */ __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; /* "cytoolz/functoolz.pyx":834 * self.exc = exc * self.func = func * self.handler = handler # <<<<<<<<<<<<<< * * def __call__(self, *args, **kwargs): */ __Pyx_INCREF(__pyx_v_handler); __Pyx_GIVEREF(__pyx_v_handler); __Pyx_GOTREF(__pyx_v_self->handler); __Pyx_DECREF(__pyx_v_self->handler); __pyx_v_self->handler = __pyx_v_handler; /* "cytoolz/functoolz.pyx":831 * """ * * def __init__(self, exc, func, handler=return_none): # <<<<<<<<<<<<<< * self.exc = exc * self.func = func */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":836 * self.handler = handler * * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< * try: * return self.func(*args, **kwargs) */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7excepts_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_7excepts_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 1))) return NULL; if (unlikely(__pyx_kwds)) { __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); } else { __pyx_v_kwargs = NULL; } __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_r = __pyx_pf_7cytoolz_9functoolz_7excepts_2__call__(((struct __pyx_obj_7cytoolz_9functoolz_excepts *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_args); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_7excepts_2__call__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) { PyObject *__pyx_v_e = 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; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; __Pyx_RefNannySetupContext("__call__", 0); /* "cytoolz/functoolz.pyx":837 * * def __call__(self, *args, **kwargs): * try: # <<<<<<<<<<<<<< * return self.func(*args, **kwargs) * except self.exc as e: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __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:*/ { /* "cytoolz/functoolz.pyx":838 * def __call__(self, *args, **kwargs): * try: * return self.func(*args, **kwargs) # <<<<<<<<<<<<<< * except self.exc as e: * return self.handler(e) */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_self->func, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 838, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L7_try_return; /* "cytoolz/functoolz.pyx":837 * * def __call__(self, *args, **kwargs): * try: # <<<<<<<<<<<<<< * return self.func(*args, **kwargs) * except self.exc as e: */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/functoolz.pyx":839 * try: * return self.func(*args, **kwargs) * except self.exc as e: # <<<<<<<<<<<<<< * return self.handler(e) * */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_v_self->exc); if (__pyx_t_5) { __Pyx_AddTraceback("cytoolz.functoolz.excepts.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 839, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_v_e = __pyx_t_6; /* "cytoolz/functoolz.pyx":840 * return self.func(*args, **kwargs) * except self.exc as e: * return self.handler(e) # <<<<<<<<<<<<<< * * property __name__: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->handler); __pyx_t_9 = __pyx_v_self->handler; __pyx_t_10 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) { __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_10)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } __pyx_t_8 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_10, __pyx_v_e) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_e); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 840, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_r = __pyx_t_8; __pyx_t_8 = 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; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "cytoolz/functoolz.pyx":837 * * def __call__(self, *args, **kwargs): * try: # <<<<<<<<<<<<<< * return self.func(*args, **kwargs) * except self.exc as e: */ __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; } /* "cytoolz/functoolz.pyx":836 * self.handler = handler * * def __call__(self, *args, **kwargs): # <<<<<<<<<<<<<< * try: * return self.func(*args, **kwargs) */ /* 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("cytoolz.functoolz.excepts.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_e); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":843 * * property __name__: * def __get__(self): # <<<<<<<<<<<<<< * exc = self.exc * try: */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7excepts_8__name___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_7excepts_8__name___1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7excepts_8__name_____get__(((struct __pyx_obj_7cytoolz_9functoolz_excepts *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_7excepts_8__name_____get__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self) { PyObject *__pyx_v_exc = NULL; PyObject *__pyx_v_exc_name = 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_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; __Pyx_RefNannySetupContext("__get__", 0); /* "cytoolz/functoolz.pyx":844 * property __name__: * def __get__(self): * exc = self.exc # <<<<<<<<<<<<<< * try: * if isinstance(exc, tuple): */ __pyx_t_1 = __pyx_v_self->exc; __Pyx_INCREF(__pyx_t_1); __pyx_v_exc = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":845 * def __get__(self): * exc = self.exc * try: # <<<<<<<<<<<<<< * if isinstance(exc, tuple): * exc_name = '_or_'.join(map(attrgetter('__name__'), exc)) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __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:*/ { /* "cytoolz/functoolz.pyx":846 * exc = self.exc * try: * if isinstance(exc, tuple): # <<<<<<<<<<<<<< * exc_name = '_or_'.join(map(attrgetter('__name__'), exc)) * else: */ __pyx_t_5 = PyTuple_Check(__pyx_v_exc); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "cytoolz/functoolz.pyx":847 * try: * if isinstance(exc, tuple): * exc_name = '_or_'.join(map(attrgetter('__name__'), exc)) # <<<<<<<<<<<<<< * else: * exc_name = exc.__name__ */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_attrgetter); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 847, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_n_s_name) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_s_name); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 847, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __Pyx_INCREF(__pyx_v_exc); __Pyx_GIVEREF(__pyx_v_exc); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_exc); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 847, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyString_Join(__pyx_n_s_or, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 847, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_exc_name = __pyx_t_7; __pyx_t_7 = 0; /* "cytoolz/functoolz.pyx":846 * exc = self.exc * try: * if isinstance(exc, tuple): # <<<<<<<<<<<<<< * exc_name = '_or_'.join(map(attrgetter('__name__'), exc)) * else: */ goto __pyx_L9; } /* "cytoolz/functoolz.pyx":849 * exc_name = '_or_'.join(map(attrgetter('__name__'), exc)) * else: * exc_name = exc.__name__ # <<<<<<<<<<<<<< * return '%s_excepting_%s' % (self.func.__name__, exc_name) * except AttributeError: */ /*else*/ { __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_exc, __pyx_n_s_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 849, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_exc_name = __pyx_t_7; __pyx_t_7 = 0; } __pyx_L9:; /* "cytoolz/functoolz.pyx":850 * else: * exc_name = exc.__name__ * return '%s_excepting_%s' % (self.func.__name__, exc_name) # <<<<<<<<<<<<<< * except AttributeError: * return 'excepting' */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->func, __pyx_n_s_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 850, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); __Pyx_INCREF(__pyx_v_exc_name); __Pyx_GIVEREF(__pyx_v_exc_name); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_exc_name); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_s_excepting__s, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 850, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L7_try_return; /* "cytoolz/functoolz.pyx":845 * def __get__(self): * exc = self.exc * try: # <<<<<<<<<<<<<< * if isinstance(exc, tuple): * exc_name = '_or_'.join(map(attrgetter('__name__'), exc)) */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "cytoolz/functoolz.pyx":851 * exc_name = exc.__name__ * return '%s_excepting_%s' % (self.func.__name__, exc_name) * except AttributeError: # <<<<<<<<<<<<<< * return 'excepting' * */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_9) { __Pyx_AddTraceback("cytoolz.functoolz.excepts.__name__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_1, &__pyx_t_8) < 0) __PYX_ERR(0, 851, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_8); /* "cytoolz/functoolz.pyx":852 * return '%s_excepting_%s' % (self.func.__name__, exc_name) * except AttributeError: * return 'excepting' # <<<<<<<<<<<<<< * * property __doc__: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_n_s_excepting); __pyx_r = __pyx_n_s_excepting; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "cytoolz/functoolz.pyx":845 * def __get__(self): * exc = self.exc * try: # <<<<<<<<<<<<<< * if isinstance(exc, tuple): * exc_name = '_or_'.join(map(attrgetter('__name__'), exc)) */ __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_try_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_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; } /* "cytoolz/functoolz.pyx":843 * * property __name__: * def __get__(self): # <<<<<<<<<<<<<< * exc = self.exc * try: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("cytoolz.functoolz.excepts.__name__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_exc); __Pyx_XDECREF(__pyx_v_exc_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pyx":855 * * property __doc__: * def __get__(self): # <<<<<<<<<<<<<< * exc = self.exc * try: */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7excepts_7__doc___1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_7excepts_7__doc___1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7excepts_7__doc_____get__(((struct __pyx_obj_7cytoolz_9functoolz_excepts *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_7excepts_7__doc_____get__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self) { PyObject *__pyx_v_exc = NULL; PyObject *__pyx_v_exc_name = 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_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; __Pyx_RefNannySetupContext("__get__", 0); /* "cytoolz/functoolz.pyx":856 * property __doc__: * def __get__(self): * exc = self.exc # <<<<<<<<<<<<<< * try: * if isinstance(exc, tuple): */ __pyx_t_1 = __pyx_v_self->exc; __Pyx_INCREF(__pyx_t_1); __pyx_v_exc = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":857 * def __get__(self): * exc = self.exc * try: # <<<<<<<<<<<<<< * if isinstance(exc, tuple): * exc_name = '(%s)' % ', '.join( */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __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:*/ { /* "cytoolz/functoolz.pyx":858 * exc = self.exc * try: * if isinstance(exc, tuple): # <<<<<<<<<<<<<< * exc_name = '(%s)' % ', '.join( * map(attrgetter('__name__'), exc), */ __pyx_t_5 = PyTuple_Check(__pyx_v_exc); __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { /* "cytoolz/functoolz.pyx":860 * if isinstance(exc, tuple): * exc_name = '(%s)' % ', '.join( * map(attrgetter('__name__'), exc), # <<<<<<<<<<<<<< * ) * else: */ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_attrgetter); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 860, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_n_s_name) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_n_s_name); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 860, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 860, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __Pyx_INCREF(__pyx_v_exc); __Pyx_GIVEREF(__pyx_v_exc); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_exc); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 860, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "cytoolz/functoolz.pyx":859 * try: * if isinstance(exc, tuple): * exc_name = '(%s)' % ', '.join( # <<<<<<<<<<<<<< * map(attrgetter('__name__'), exc), * ) */ __pyx_t_7 = __Pyx_PyString_Join(__pyx_kp_s__14, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 859, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_exc_name = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":858 * exc = self.exc * try: * if isinstance(exc, tuple): # <<<<<<<<<<<<<< * exc_name = '(%s)' % ', '.join( * map(attrgetter('__name__'), exc), */ goto __pyx_L9; } /* "cytoolz/functoolz.pyx":863 * ) * else: * exc_name = exc.__name__ # <<<<<<<<<<<<<< * * return dedent( */ /*else*/ { __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_exc, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 863, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_exc_name = __pyx_t_1; __pyx_t_1 = 0; } __pyx_L9:; /* "cytoolz/functoolz.pyx":865 * exc_name = exc.__name__ * * return dedent( # <<<<<<<<<<<<<< * """\ * A wrapper around {inst.func.__name__!r} that will except: */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_dedent); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 865, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_kp_s_A_wrapper_around_inst_func___na) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_kp_s_A_wrapper_around_inst_func___na); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "cytoolz/functoolz.pyx":877 * {inst.handler.__doc__} * """ * ).format( # <<<<<<<<<<<<<< * inst=self, * exc=exc_name, */ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 877, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":878 * """ * ).format( * inst=self, # <<<<<<<<<<<<<< * exc=exc_name, * ) */ __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_inst, ((PyObject *)__pyx_v_self)) < 0) __PYX_ERR(0, 878, __pyx_L3_error) /* "cytoolz/functoolz.pyx":879 * ).format( * inst=self, * exc=exc_name, # <<<<<<<<<<<<<< * ) * except AttributeError: */ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_exc, __pyx_v_exc_name) < 0) __PYX_ERR(0, 878, __pyx_L3_error) /* "cytoolz/functoolz.pyx":877 * {inst.handler.__doc__} * """ * ).format( # <<<<<<<<<<<<<< * inst=self, * exc=exc_name, */ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 877, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L7_try_return; /* "cytoolz/functoolz.pyx":857 * def __get__(self): * exc = self.exc * try: # <<<<<<<<<<<<<< * if isinstance(exc, tuple): * exc_name = '(%s)' % ', '.join( */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /* "cytoolz/functoolz.pyx":881 * exc=exc_name, * ) * except AttributeError: # <<<<<<<<<<<<<< * return type(self).__doc__ * */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError); if (__pyx_t_9) { __Pyx_AddTraceback("cytoolz.functoolz.excepts.__doc__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_1, &__pyx_t_7) < 0) __PYX_ERR(0, 881, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_7); /* "cytoolz/functoolz.pyx":882 * ) * except AttributeError: * return type(self).__doc__ # <<<<<<<<<<<<<< * */ __Pyx_XDECREF(__pyx_r); __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_doc); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 882, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_r = __pyx_t_10; __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "cytoolz/functoolz.pyx":857 * def __get__(self): * exc = self.exc * try: # <<<<<<<<<<<<<< * if isinstance(exc, tuple): * exc_name = '(%s)' % ', '.join( */ __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_try_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_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; } /* "cytoolz/functoolz.pyx":855 * * property __doc__: * def __get__(self): # <<<<<<<<<<<<<< * exc = self.exc * try: */ /* 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_10); __Pyx_AddTraceback("cytoolz.functoolz.excepts.__doc__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_exc); __Pyx_XDECREF(__pyx_v_exc_name); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pxd":68 * * cdef class excepts: * cdef public object exc # <<<<<<<<<<<<<< * cdef public object func * cdef public object handler */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7excepts_3exc_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_7excepts_3exc_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7excepts_3exc___get__(((struct __pyx_obj_7cytoolz_9functoolz_excepts *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_7excepts_3exc___get__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->exc); __pyx_r = __pyx_v_self->exc; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_7excepts_3exc_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_7excepts_3exc_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7excepts_3exc_2__set__(((struct __pyx_obj_7cytoolz_9functoolz_excepts *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_7excepts_3exc_2__set__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__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->exc); __Pyx_DECREF(__pyx_v_self->exc); __pyx_v_self->exc = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_7excepts_3exc_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_7excepts_3exc_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7excepts_3exc_4__del__(((struct __pyx_obj_7cytoolz_9functoolz_excepts *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_7excepts_3exc_4__del__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__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->exc); __Pyx_DECREF(__pyx_v_self->exc); __pyx_v_self->exc = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pxd":69 * cdef class excepts: * cdef public object exc * cdef public object func # <<<<<<<<<<<<<< * cdef public object handler * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7excepts_4func_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_7excepts_4func_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7excepts_4func___get__(((struct __pyx_obj_7cytoolz_9functoolz_excepts *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_7excepts_4func___get__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__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 int __pyx_pw_7cytoolz_9functoolz_7excepts_4func_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_7excepts_4func_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7excepts_4func_2__set__(((struct __pyx_obj_7cytoolz_9functoolz_excepts *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_7excepts_4func_2__set__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__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->func); __Pyx_DECREF(__pyx_v_self->func); __pyx_v_self->func = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_7excepts_4func_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_7excepts_4func_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7excepts_4func_4__del__(((struct __pyx_obj_7cytoolz_9functoolz_excepts *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_7excepts_4func_4__del__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__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->func); __Pyx_DECREF(__pyx_v_self->func); __pyx_v_self->func = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/functoolz.pxd":70 * cdef public object exc * cdef public object func * cdef public object handler # <<<<<<<<<<<<<< * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7excepts_7handler_1__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9functoolz_7excepts_7handler_1__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7excepts_7handler___get__(((struct __pyx_obj_7cytoolz_9functoolz_excepts *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_7excepts_7handler___get__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__get__", 0); __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->handler); __pyx_r = __pyx_v_self->handler; goto __pyx_L0; /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_7excepts_7handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_7excepts_7handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__set__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7excepts_7handler_2__set__(((struct __pyx_obj_7cytoolz_9functoolz_excepts *)__pyx_v_self), ((PyObject *)__pyx_v_value)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_7excepts_7handler_2__set__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__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->handler); __Pyx_DECREF(__pyx_v_self->handler); __pyx_v_self->handler = __pyx_v_value; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static int __pyx_pw_7cytoolz_9functoolz_7excepts_7handler_5__del__(PyObject *__pyx_v_self); /*proto*/ static int __pyx_pw_7cytoolz_9functoolz_7excepts_7handler_5__del__(PyObject *__pyx_v_self) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__del__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7excepts_7handler_4__del__(((struct __pyx_obj_7cytoolz_9functoolz_excepts *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9functoolz_7excepts_7handler_4__del__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__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->handler); __Pyx_DECREF(__pyx_v_self->handler); __pyx_v_self->handler = Py_None; /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7excepts_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_7excepts_4__reduce_cython__[] = "excepts.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_7excepts_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9functoolz_7excepts_5__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9functoolz_7excepts_4__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9functoolz_7excepts_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7excepts_4__reduce_cython__(((struct __pyx_obj_7cytoolz_9functoolz_excepts *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_7excepts_4__reduce_cython__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; 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; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = (self.exc, self.func, self.handler) # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_self->exc); __Pyx_GIVEREF(__pyx_v_self->exc); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->exc); __Pyx_INCREF(__pyx_v_self->func); __Pyx_GIVEREF(__pyx_v_self->func); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->func); __Pyx_INCREF(__pyx_v_self->handler); __Pyx_GIVEREF(__pyx_v_self->handler); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_self->handler); __pyx_v_state = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":6 * cdef bint use_setstate * state = (self.exc, self.func, self.handler) * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__dict = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":7 * state = (self.exc, self.func, self.handler) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_2 = (__pyx_v__dict != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict); __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = self.exc is not None or self.func is not None or self.handler is not None */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = (self.exc, self.func, self.handler) * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = self.exc is not None or self.func is not None or self.handler is not None # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle_excepts, (type(self), 0x75ac63f, None), state */ /*else*/ { __pyx_t_2 = (__pyx_v_self->exc != Py_None); __pyx_t_5 = (__pyx_t_2 != 0); if (!__pyx_t_5) { } else { __pyx_t_3 = __pyx_t_5; goto __pyx_L4_bool_binop_done; } __pyx_t_5 = (__pyx_v_self->func != Py_None); __pyx_t_2 = (__pyx_t_5 != 0); if (!__pyx_t_2) { } else { __pyx_t_3 = __pyx_t_2; goto __pyx_L4_bool_binop_done; } __pyx_t_2 = (__pyx_v_self->handler != Py_None); __pyx_t_5 = (__pyx_t_2 != 0); __pyx_t_3 = __pyx_t_5; __pyx_L4_bool_binop_done:; __pyx_v_use_setstate = __pyx_t_3; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = self.exc is not None or self.func is not None or self.handler is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_excepts, (type(self), 0x75ac63f, None), state * else: */ __pyx_t_3 = (__pyx_v_use_setstate != 0); if (__pyx_t_3) { /* "(tree fragment)":13 * use_setstate = self.exc is not None or self.func is not None or self.handler is not None * if use_setstate: * return __pyx_unpickle_excepts, (type(self), 0x75ac63f, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle_excepts, (type(self), 0x75ac63f, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_excepts); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_123389503); __Pyx_GIVEREF(__pyx_int_123389503); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_123389503); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state); __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = self.exc is not None or self.func is not None or self.handler is not None * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle_excepts, (type(self), 0x75ac63f, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle_excepts, (type(self), 0x75ac63f, None), state * else: * return __pyx_unpickle_excepts, (type(self), 0x75ac63f, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_excepts__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_excepts); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_123389503); __Pyx_GIVEREF(__pyx_int_123389503); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_123389503); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __pyx_t_6 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("cytoolz.functoolz.excepts.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle_excepts, (type(self), 0x75ac63f, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_excepts__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_7excepts_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_7excepts_6__setstate_cython__[] = "excepts.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_7excepts_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9functoolz_7excepts_7__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9functoolz_7excepts_6__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9functoolz_7excepts_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9functoolz_7excepts_6__setstate_cython__(((struct __pyx_obj_7cytoolz_9functoolz_excepts *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_7excepts_6__setstate_cython__(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":17 * return __pyx_unpickle_excepts, (type(self), 0x75ac63f, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle_excepts__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) __pyx_t_1 = __pyx_f_7cytoolz_9functoolz___pyx_unpickle_excepts__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_excepts, (type(self), 0x75ac63f, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_excepts__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.functoolz.excepts.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle_excepts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9functoolz_28__pyx_unpickle_excepts(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9functoolz_27__pyx_unpickle_excepts[] = "__pyx_unpickle_excepts(__pyx_type, long __pyx_checksum, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9functoolz_28__pyx_unpickle_excepts = {"__pyx_unpickle_excepts", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9functoolz_28__pyx_unpickle_excepts, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9functoolz_27__pyx_unpickle_excepts}; static PyObject *__pyx_pw_7cytoolz_9functoolz_28__pyx_unpickle_excepts(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle_excepts (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_excepts", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_excepts", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_excepts") < 0)) __PYX_ERR(1, 1, __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___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_excepts", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.functoolz.__pyx_unpickle_excepts", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9functoolz_27__pyx_unpickle_excepts(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9functoolz_27__pyx_unpickle_excepts(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; 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_t_6; __Pyx_RefNannySetupContext("__pyx_unpickle_excepts", 0); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum != 0x75ac63f: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x75ac63f = (exc, func, handler))" % __pyx_checksum) */ __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x75ac63f) != 0); if (__pyx_t_1) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum != 0x75ac63f: * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError("Incompatible checksums (%s vs 0x75ac63f = (exc, func, handler))" % __pyx_checksum) * __pyx_result = excepts.__new__(__pyx_type) */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __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_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_v___pyx_PickleError = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum != 0x75ac63f: * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x75ac63f = (exc, func, handler))" % __pyx_checksum) # <<<<<<<<<<<<<< * __pyx_result = excepts.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x75, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __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_ERR(1, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum != 0x75ac63f: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x75ac63f = (exc, func, handler))" % __pyx_checksum) */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0x75ac63f = (exc, func, handler))" % __pyx_checksum) * __pyx_result = excepts.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle_excepts__set_state( __pyx_result, __pyx_state) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7cytoolz_9functoolz_excepts), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v___pyx_result = __pyx_t_3; __pyx_t_3 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x75ac63f = (exc, func, handler))" % __pyx_checksum) * __pyx_result = excepts.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_excepts__set_state( __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_1 = (__pyx_v___pyx_state != Py_None); __pyx_t_6 = (__pyx_t_1 != 0); if (__pyx_t_6) { /* "(tree fragment)":9 * __pyx_result = excepts.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle_excepts__set_state( __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle_excepts__set_state(excepts __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) __pyx_t_3 = __pyx_f_7cytoolz_9functoolz___pyx_unpickle_excepts__set_state(((struct __pyx_obj_7cytoolz_9functoolz_excepts *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError("Incompatible checksums (%s vs 0x75ac63f = (exc, func, handler))" % __pyx_checksum) * __pyx_result = excepts.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle_excepts__set_state( __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle_excepts__set_state( __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle_excepts__set_state(excepts __pyx_result, tuple __pyx_state): * __pyx_result.exc = __pyx_state[0]; __pyx_result.func = __pyx_state[1]; __pyx_result.handler = __pyx_state[2] */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle_excepts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_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("cytoolz.functoolz.__pyx_unpickle_excepts", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle_excepts__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_excepts__set_state(excepts __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result.exc = __pyx_state[0]; __pyx_result.func = __pyx_state[1]; __pyx_result.handler = __pyx_state[2] * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): */ static PyObject *__pyx_f_7cytoolz_9functoolz___pyx_unpickle_excepts__set_state(struct __pyx_obj_7cytoolz_9functoolz_excepts *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __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; __Pyx_RefNannySetupContext("__pyx_unpickle_excepts__set_state", 0); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle_excepts__set_state(excepts __pyx_result, tuple __pyx_state): * __pyx_result.exc = __pyx_state[0]; __pyx_result.func = __pyx_state[1]; __pyx_result.handler = __pyx_state[2] # <<<<<<<<<<<<<< * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[3]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->exc); __Pyx_DECREF(__pyx_v___pyx_result->exc); __pyx_v___pyx_result->exc = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->func); __Pyx_DECREF(__pyx_v___pyx_result->func); __pyx_v___pyx_result->func = __pyx_t_1; __pyx_t_1 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v___pyx_result->handler); __Pyx_DECREF(__pyx_v___pyx_result->handler); __pyx_v___pyx_result->handler = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_excepts__set_state(excepts __pyx_result, tuple __pyx_state): * __pyx_result.exc = __pyx_state[0]; __pyx_result.func = __pyx_state[1]; __pyx_result.handler = __pyx_state[2] * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[3]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(1, 13, __pyx_L1_error) } __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_4 = ((__pyx_t_3 > 3) != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error) __pyx_t_5 = (__pyx_t_4 != 0); __pyx_t_2 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "(tree fragment)":14 * __pyx_result.exc = __pyx_state[0]; __pyx_result.func = __pyx_state[1]; __pyx_result.handler = __pyx_state[2] * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[3]) # <<<<<<<<<<<<<< */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 14, __pyx_L1_error) } __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":13 * cdef __pyx_unpickle_excepts__set_state(excepts __pyx_result, tuple __pyx_state): * __pyx_result.exc = __pyx_state[0]; __pyx_result.func = __pyx_state[1]; __pyx_result.handler = __pyx_state[2] * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[3]) */ } /* "(tree fragment)":11 * __pyx_unpickle_excepts__set_state( __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle_excepts__set_state(excepts __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * __pyx_result.exc = __pyx_state[0]; __pyx_result.func = __pyx_state[1]; __pyx_result.handler = __pyx_state[2] * if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'): */ /* 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_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_AddTraceback("cytoolz.functoolz.__pyx_unpickle_excepts__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_7cytoolz_9functoolz_curry(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9functoolz_curry *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_7cytoolz_9functoolz_curry *)o); p->_sigspec = Py_None; Py_INCREF(Py_None); p->_has_unknown_args = Py_None; Py_INCREF(Py_None); p->func = Py_None; Py_INCREF(Py_None); p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); p->keywords = ((PyObject*)Py_None); Py_INCREF(Py_None); p->__doc__ = Py_None; Py_INCREF(Py_None); p->__name__ = Py_None; Py_INCREF(Py_None); p->__module__ = Py_None; Py_INCREF(Py_None); p->__qualname__ = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9functoolz_5curry_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9functoolz_curry(PyObject *o) { struct __pyx_obj_7cytoolz_9functoolz_curry *p = (struct __pyx_obj_7cytoolz_9functoolz_curry *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->_sigspec); Py_CLEAR(p->_has_unknown_args); Py_CLEAR(p->func); Py_CLEAR(p->args); Py_CLEAR(p->keywords); Py_CLEAR(p->__doc__); Py_CLEAR(p->__name__); Py_CLEAR(p->__module__); Py_CLEAR(p->__qualname__); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9functoolz_curry(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9functoolz_curry *p = (struct __pyx_obj_7cytoolz_9functoolz_curry *)o; if (p->_sigspec) { e = (*v)(p->_sigspec, a); if (e) return e; } if (p->_has_unknown_args) { e = (*v)(p->_has_unknown_args, a); if (e) return e; } if (p->func) { e = (*v)(p->func, a); if (e) return e; } if (p->args) { e = (*v)(p->args, a); if (e) return e; } if (p->keywords) { e = (*v)(p->keywords, a); if (e) return e; } if (p->__doc__) { e = (*v)(p->__doc__, a); if (e) return e; } if (p->__name__) { e = (*v)(p->__name__, a); if (e) return e; } if (p->__module__) { e = (*v)(p->__module__, a); if (e) return e; } if (p->__qualname__) { e = (*v)(p->__qualname__, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9functoolz_curry(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9functoolz_curry *p = (struct __pyx_obj_7cytoolz_9functoolz_curry *)o; tmp = ((PyObject*)p->_sigspec); p->_sigspec = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_has_unknown_args); p->_has_unknown_args = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->func); p->func = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->args); p->args = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->keywords); p->keywords = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__doc__); p->__doc__ = 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->__module__); p->__module__ = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__qualname__); p->__qualname__ = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_tp_descr_get_7cytoolz_9functoolz_curry(PyObject *o, PyObject *i, PyObject *c) { PyObject *r = 0; if (!i) i = Py_None; if (!c) c = Py_None; r = __pyx_pw_7cytoolz_9functoolz_5curry_21__get__(o, i, c); return r; } static PyObject *__pyx_getprop_7cytoolz_9functoolz_5curry___signature__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_5curry_13__signature___1__get__(o); } static PyObject *__pyx_getprop_7cytoolz_9functoolz_5curry__sigspec(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_5curry_8_sigspec_1__get__(o); } static PyObject *__pyx_getprop_7cytoolz_9functoolz_5curry__has_unknown_args(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_5curry_17_has_unknown_args_1__get__(o); } static PyObject *__pyx_getprop_7cytoolz_9functoolz_5curry_func(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_5curry_4func_1__get__(o); } static PyObject *__pyx_getprop_7cytoolz_9functoolz_5curry_args(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_5curry_4args_1__get__(o); } static PyObject *__pyx_getprop_7cytoolz_9functoolz_5curry_keywords(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_5curry_8keywords_1__get__(o); } static PyObject *__pyx_getprop_7cytoolz_9functoolz_5curry___doc__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_5curry_7__doc___1__get__(o); } static int __pyx_setprop_7cytoolz_9functoolz_5curry___doc__(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_7cytoolz_9functoolz_5curry_7__doc___3__set__(o, v); } else { return __pyx_pw_7cytoolz_9functoolz_5curry_7__doc___5__del__(o); } } static PyObject *__pyx_getprop_7cytoolz_9functoolz_5curry___name__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_5curry_8__name___1__get__(o); } static int __pyx_setprop_7cytoolz_9functoolz_5curry___name__(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_7cytoolz_9functoolz_5curry_8__name___3__set__(o, v); } else { return __pyx_pw_7cytoolz_9functoolz_5curry_8__name___5__del__(o); } } static PyObject *__pyx_getprop_7cytoolz_9functoolz_5curry___module__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_5curry_10__module___1__get__(o); } static int __pyx_setprop_7cytoolz_9functoolz_5curry___module__(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_7cytoolz_9functoolz_5curry_10__module___3__set__(o, v); } else { return __pyx_pw_7cytoolz_9functoolz_5curry_10__module___5__del__(o); } } static PyObject *__pyx_getprop_7cytoolz_9functoolz_5curry___qualname__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_5curry_12__qualname___1__get__(o); } static int __pyx_setprop_7cytoolz_9functoolz_5curry___qualname__(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_7cytoolz_9functoolz_5curry_12__qualname___3__set__(o, v); } else { return __pyx_pw_7cytoolz_9functoolz_5curry_12__qualname___5__del__(o); } } static PyMethodDef __pyx_methods_7cytoolz_9functoolz_curry[] = { {"_should_curry", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9functoolz_5curry_13_should_curry, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9functoolz_5curry_12_should_curry}, {"_should_curry_internal", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9functoolz_5curry_15_should_curry_internal, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9functoolz_5curry_14_should_curry_internal}, {"bind", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9functoolz_5curry_17bind, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9functoolz_5curry_16bind}, {"call", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9functoolz_5curry_19call, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9functoolz_5curry_18call}, {"__reduce__", (PyCFunction)__pyx_pw_7cytoolz_9functoolz_5curry_23__reduce__, METH_NOARGS, __pyx_doc_7cytoolz_9functoolz_5curry_22__reduce__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_7cytoolz_9functoolz_curry[] = { {(char *)"__signature__", __pyx_getprop_7cytoolz_9functoolz_5curry___signature__, 0, (char *)0, 0}, {(char *)"_sigspec", __pyx_getprop_7cytoolz_9functoolz_5curry__sigspec, 0, (char *)0, 0}, {(char *)"_has_unknown_args", __pyx_getprop_7cytoolz_9functoolz_5curry__has_unknown_args, 0, (char *)0, 0}, {(char *)"func", __pyx_getprop_7cytoolz_9functoolz_5curry_func, 0, (char *)0, 0}, {(char *)"args", __pyx_getprop_7cytoolz_9functoolz_5curry_args, 0, (char *)0, 0}, {(char *)"keywords", __pyx_getprop_7cytoolz_9functoolz_5curry_keywords, 0, (char *)0, 0}, {(char *)"__doc__", __pyx_getprop_7cytoolz_9functoolz_5curry___doc__, __pyx_setprop_7cytoolz_9functoolz_5curry___doc__, (char *)"__doc__: object", 0}, {(char *)"__name__", __pyx_getprop_7cytoolz_9functoolz_5curry___name__, __pyx_setprop_7cytoolz_9functoolz_5curry___name__, (char *)"__name__: object", 0}, {(char *)"__module__", __pyx_getprop_7cytoolz_9functoolz_5curry___module__, __pyx_setprop_7cytoolz_9functoolz_5curry___module__, (char *)"__module__: object", 0}, {(char *)"__qualname__", __pyx_getprop_7cytoolz_9functoolz_5curry___qualname__, __pyx_setprop_7cytoolz_9functoolz_5curry___qualname__, (char *)"__qualname__: object", 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9functoolz_curry = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.functoolz.curry", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9functoolz_curry), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9functoolz_curry, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_7cytoolz_9functoolz_5curry_5__repr__, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ __pyx_pw_7cytoolz_9functoolz_5curry_7__hash__, /*tp_hash*/ __pyx_pw_7cytoolz_9functoolz_5curry_11__call__, /*tp_call*/ __pyx_pw_7cytoolz_9functoolz_5curry_3__str__, /*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*/ " curry(self, *args, **kwargs)\n\n Curry a callable function\n\n Enables partial application of arguments through calling a function with an\n incomplete set of arguments.\n\n >>> def mul(x, y):\n ... return x * y\n >>> mul = curry(mul)\n\n >>> double = mul(2)\n >>> double(10)\n 20\n\n Also supports keyword arguments\n\n >>> @curry # Can use curry as a decorator\n ... def f(x, y, a=10):\n ... return a * (x + y)\n\n >>> add = f(a=1)\n >>> add(2, 3)\n 5\n\n See Also:\n cytoolz.curried - namespace of curried functions\n https://toolz.readthedocs.io/en/latest/curry.html\n ", /*tp_doc*/ __pyx_tp_traverse_7cytoolz_9functoolz_curry, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9functoolz_curry, /*tp_clear*/ __pyx_pw_7cytoolz_9functoolz_5curry_9__richcmp__, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7cytoolz_9functoolz_curry, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_7cytoolz_9functoolz_curry, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ __pyx_tp_descr_get_7cytoolz_9functoolz_curry, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7cytoolz_9functoolz_curry, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9functoolz__memoize(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9functoolz__memoize *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_7cytoolz_9functoolz__memoize *)o); p->func = Py_None; Py_INCREF(Py_None); p->cache = Py_None; Py_INCREF(Py_None); p->key = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9functoolz_8_memoize_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9functoolz__memoize(PyObject *o) { struct __pyx_obj_7cytoolz_9functoolz__memoize *p = (struct __pyx_obj_7cytoolz_9functoolz__memoize *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && 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->cache); Py_CLEAR(p->key); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9functoolz__memoize(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9functoolz__memoize *p = (struct __pyx_obj_7cytoolz_9functoolz__memoize *)o; if (p->func) { e = (*v)(p->func, a); if (e) return e; } if (p->cache) { e = (*v)(p->cache, a); if (e) return e; } if (p->key) { e = (*v)(p->key, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9functoolz__memoize(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9functoolz__memoize *p = (struct __pyx_obj_7cytoolz_9functoolz__memoize *)o; tmp = ((PyObject*)p->func); p->func = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->cache); p->cache = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->key); p->key = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_tp_descr_get_7cytoolz_9functoolz__memoize(PyObject *o, PyObject *i, PyObject *c) { PyObject *r = 0; if (!i) i = Py_None; if (!c) c = Py_None; r = __pyx_pw_7cytoolz_9functoolz_8_memoize_5__get__(o, i, c); return r; } static PyObject *__pyx_getprop_7cytoolz_9functoolz_8_memoize___doc__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_8_memoize_7__doc___1__get__(o); } static PyObject *__pyx_getprop_7cytoolz_9functoolz_8_memoize___name__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_8_memoize_8__name___1__get__(o); } static PyObject *__pyx_getprop_7cytoolz_9functoolz_8_memoize___wrapped__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_8_memoize_11__wrapped___1__get__(o); } static PyMethodDef __pyx_methods_7cytoolz_9functoolz__memoize[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9functoolz_8_memoize_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9functoolz_8_memoize_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9functoolz_8_memoize_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9functoolz_8_memoize_8__setstate_cython__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_7cytoolz_9functoolz__memoize[] = { {(char *)"__doc__", __pyx_getprop_7cytoolz_9functoolz_8_memoize___doc__, 0, (char *)0, 0}, {(char *)"__name__", __pyx_getprop_7cytoolz_9functoolz_8_memoize___name__, 0, (char *)0, 0}, {(char *)"__wrapped__", __pyx_getprop_7cytoolz_9functoolz_8_memoize___wrapped__, 0, (char *)0, 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9functoolz__memoize = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.functoolz._memoize", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9functoolz__memoize), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9functoolz__memoize, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_7cytoolz_9functoolz_8_memoize_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_7cytoolz_9functoolz__memoize, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9functoolz__memoize, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7cytoolz_9functoolz__memoize, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_7cytoolz_9functoolz__memoize, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ __pyx_tp_descr_get_7cytoolz_9functoolz__memoize, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7cytoolz_9functoolz__memoize, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9functoolz_Compose(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9functoolz_Compose *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_7cytoolz_9functoolz_Compose *)o); p->first = Py_None; Py_INCREF(Py_None); p->funcs = ((PyObject*)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9functoolz_7Compose_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9functoolz_Compose(PyObject *o) { struct __pyx_obj_7cytoolz_9functoolz_Compose *p = (struct __pyx_obj_7cytoolz_9functoolz_Compose *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->first); Py_CLEAR(p->funcs); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9functoolz_Compose(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9functoolz_Compose *p = (struct __pyx_obj_7cytoolz_9functoolz_Compose *)o; if (p->first) { e = (*v)(p->first, a); if (e) return e; } if (p->funcs) { e = (*v)(p->funcs, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9functoolz_Compose(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9functoolz_Compose *p = (struct __pyx_obj_7cytoolz_9functoolz_Compose *)o; tmp = ((PyObject*)p->first); p->first = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->funcs); p->funcs = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_tp_descr_get_7cytoolz_9functoolz_Compose(PyObject *o, PyObject *i, PyObject *c) { PyObject *r = 0; if (!i) i = Py_None; if (!c) c = Py_None; r = __pyx_pw_7cytoolz_9functoolz_7Compose_17__get__(o, i, c); return r; } static PyObject *__pyx_tp_richcompare_7cytoolz_9functoolz_Compose(PyObject *o1, PyObject *o2, int op) { switch (op) { case Py_EQ: { return __pyx_pw_7cytoolz_9functoolz_7Compose_11__eq__(o1, o2); } case Py_NE: { return __pyx_pw_7cytoolz_9functoolz_7Compose_13__ne__(o1, o2); } default: { return __Pyx_NewRef(Py_NotImplemented); } } } static PyObject *__pyx_getprop_7cytoolz_9functoolz_7Compose___wrapped__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_7Compose_11__wrapped___1__get__(o); } static PyObject *__pyx_getprop_7cytoolz_9functoolz_7Compose___signature__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_7Compose_13__signature___1__get__(o); } static PyObject *__pyx_getprop_7cytoolz_9functoolz_7Compose___name__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_7Compose_8__name___1__get__(o); } static PyObject *__pyx_getprop_7cytoolz_9functoolz_7Compose___doc__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_7Compose_7__doc___1__get__(o); } static PyObject *__pyx_getprop_7cytoolz_9functoolz_7Compose_first(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_7Compose_5first_1__get__(o); } static int __pyx_setprop_7cytoolz_9functoolz_7Compose_first(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_7cytoolz_9functoolz_7Compose_5first_3__set__(o, v); } else { return __pyx_pw_7cytoolz_9functoolz_7Compose_5first_5__del__(o); } } static PyObject *__pyx_getprop_7cytoolz_9functoolz_7Compose_funcs(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_7Compose_5funcs_1__get__(o); } static int __pyx_setprop_7cytoolz_9functoolz_7Compose_funcs(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_7cytoolz_9functoolz_7Compose_5funcs_3__set__(o, v); } else { return __pyx_pw_7cytoolz_9functoolz_7Compose_5funcs_5__del__(o); } } static PyMethodDef __pyx_methods_7cytoolz_9functoolz_Compose[] = { {"__reduce__", (PyCFunction)__pyx_pw_7cytoolz_9functoolz_7Compose_5__reduce__, METH_NOARGS, __pyx_doc_7cytoolz_9functoolz_7Compose_4__reduce__}, {"__setstate__", (PyCFunction)__pyx_pw_7cytoolz_9functoolz_7Compose_7__setstate__, METH_O, __pyx_doc_7cytoolz_9functoolz_7Compose_6__setstate__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_7cytoolz_9functoolz_Compose[] = { {(char *)"__wrapped__", __pyx_getprop_7cytoolz_9functoolz_7Compose___wrapped__, 0, (char *)0, 0}, {(char *)"__signature__", __pyx_getprop_7cytoolz_9functoolz_7Compose___signature__, 0, (char *)0, 0}, {(char *)"__name__", __pyx_getprop_7cytoolz_9functoolz_7Compose___name__, 0, (char *)0, 0}, {(char *)"__doc__", __pyx_getprop_7cytoolz_9functoolz_7Compose___doc__, 0, (char *)0, 0}, {(char *)"first", __pyx_getprop_7cytoolz_9functoolz_7Compose_first, __pyx_setprop_7cytoolz_9functoolz_7Compose_first, (char *)"first: object", 0}, {(char *)"funcs", __pyx_getprop_7cytoolz_9functoolz_7Compose_funcs, __pyx_setprop_7cytoolz_9functoolz_7Compose_funcs, (char *)"funcs: tuple", 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9functoolz_Compose = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.functoolz.Compose", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9functoolz_Compose), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9functoolz_Compose, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif __pyx_pw_7cytoolz_9functoolz_7Compose_9__repr__, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ __pyx_pw_7cytoolz_9functoolz_7Compose_15__hash__, /*tp_hash*/ __pyx_pw_7cytoolz_9functoolz_7Compose_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*/ " Compose(self, *funcs)\n\n A composition of functions\n\n See Also:\n compose\n ", /*tp_doc*/ __pyx_tp_traverse_7cytoolz_9functoolz_Compose, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9functoolz_Compose, /*tp_clear*/ __pyx_tp_richcompare_7cytoolz_9functoolz_Compose, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7cytoolz_9functoolz_Compose, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_7cytoolz_9functoolz_Compose, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ __pyx_tp_descr_get_7cytoolz_9functoolz_Compose, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ 0, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7cytoolz_9functoolz_Compose, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9functoolz_complement(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9functoolz_complement *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_7cytoolz_9functoolz_complement *)o); p->func = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9functoolz_10complement_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9functoolz_complement(PyObject *o) { struct __pyx_obj_7cytoolz_9functoolz_complement *p = (struct __pyx_obj_7cytoolz_9functoolz_complement *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->func); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9functoolz_complement(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9functoolz_complement *p = (struct __pyx_obj_7cytoolz_9functoolz_complement *)o; if (p->func) { e = (*v)(p->func, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9functoolz_complement(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9functoolz_complement *p = (struct __pyx_obj_7cytoolz_9functoolz_complement *)o; tmp = ((PyObject*)p->func); p->func = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_7cytoolz_9functoolz_complement[] = { {"__reduce__", (PyCFunction)__pyx_pw_7cytoolz_9functoolz_10complement_5__reduce__, METH_NOARGS, __pyx_doc_7cytoolz_9functoolz_10complement_4__reduce__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9functoolz_complement = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.functoolz.complement", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9functoolz_complement), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9functoolz_complement, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_7cytoolz_9functoolz_10complement_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*/ " complement(func)\n\n Convert a predicate function to its logical complement.\n\n In other words, return a function that, for inputs that normally\n yield True, yields False, and vice-versa.\n\n >>> def iseven(n): return n % 2 == 0\n >>> isodd = complement(iseven)\n >>> iseven(2)\n True\n >>> isodd(2)\n False\n ", /*tp_doc*/ __pyx_tp_traverse_7cytoolz_9functoolz_complement, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9functoolz_complement, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7cytoolz_9functoolz_complement, /*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_7cytoolz_9functoolz_complement, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9functoolz__juxt_inner(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *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_7cytoolz_9functoolz__juxt_inner *)o); p->funcs = ((PyObject*)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9functoolz_11_juxt_inner_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9functoolz__juxt_inner(PyObject *o) { struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *p = (struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->funcs); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9functoolz__juxt_inner(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *p = (struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *)o; if (p->funcs) { e = (*v)(p->funcs, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9functoolz__juxt_inner(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *p = (struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *)o; tmp = ((PyObject*)p->funcs); p->funcs = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_7cytoolz_9functoolz_11_juxt_inner_funcs(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_11_juxt_inner_5funcs_1__get__(o); } static int __pyx_setprop_7cytoolz_9functoolz_11_juxt_inner_funcs(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_7cytoolz_9functoolz_11_juxt_inner_5funcs_3__set__(o, v); } else { return __pyx_pw_7cytoolz_9functoolz_11_juxt_inner_5funcs_5__del__(o); } } static PyMethodDef __pyx_methods_7cytoolz_9functoolz__juxt_inner[] = { {"__reduce__", (PyCFunction)__pyx_pw_7cytoolz_9functoolz_11_juxt_inner_5__reduce__, METH_NOARGS, __pyx_doc_7cytoolz_9functoolz_11_juxt_inner_4__reduce__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_7cytoolz_9functoolz__juxt_inner[] = { {(char *)"funcs", __pyx_getprop_7cytoolz_9functoolz_11_juxt_inner_funcs, __pyx_setprop_7cytoolz_9functoolz_11_juxt_inner_funcs, (char *)"funcs: tuple", 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9functoolz__juxt_inner = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.functoolz._juxt_inner", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9functoolz__juxt_inner), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9functoolz__juxt_inner, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_7cytoolz_9functoolz_11_juxt_inner_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_7cytoolz_9functoolz__juxt_inner, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9functoolz__juxt_inner, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7cytoolz_9functoolz__juxt_inner, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_7cytoolz_9functoolz__juxt_inner, /*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_7cytoolz_9functoolz__juxt_inner, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9functoolz_excepts(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { struct __pyx_obj_7cytoolz_9functoolz_excepts *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_7cytoolz_9functoolz_excepts *)o); p->exc = Py_None; Py_INCREF(Py_None); p->func = Py_None; Py_INCREF(Py_None); p->handler = Py_None; Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_7cytoolz_9functoolz_excepts(PyObject *o) { struct __pyx_obj_7cytoolz_9functoolz_excepts *p = (struct __pyx_obj_7cytoolz_9functoolz_excepts *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->exc); Py_CLEAR(p->func); Py_CLEAR(p->handler); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9functoolz_excepts(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9functoolz_excepts *p = (struct __pyx_obj_7cytoolz_9functoolz_excepts *)o; if (p->exc) { e = (*v)(p->exc, a); if (e) return e; } if (p->func) { e = (*v)(p->func, a); if (e) return e; } if (p->handler) { e = (*v)(p->handler, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9functoolz_excepts(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9functoolz_excepts *p = (struct __pyx_obj_7cytoolz_9functoolz_excepts *)o; tmp = ((PyObject*)p->exc); p->exc = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->func); p->func = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->handler); p->handler = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_7cytoolz_9functoolz_7excepts___name__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_7excepts_8__name___1__get__(o); } static PyObject *__pyx_getprop_7cytoolz_9functoolz_7excepts___doc__(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_7excepts_7__doc___1__get__(o); } static PyObject *__pyx_getprop_7cytoolz_9functoolz_7excepts_exc(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_7excepts_3exc_1__get__(o); } static int __pyx_setprop_7cytoolz_9functoolz_7excepts_exc(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_7cytoolz_9functoolz_7excepts_3exc_3__set__(o, v); } else { return __pyx_pw_7cytoolz_9functoolz_7excepts_3exc_5__del__(o); } } static PyObject *__pyx_getprop_7cytoolz_9functoolz_7excepts_func(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_7excepts_4func_1__get__(o); } static int __pyx_setprop_7cytoolz_9functoolz_7excepts_func(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_7cytoolz_9functoolz_7excepts_4func_3__set__(o, v); } else { return __pyx_pw_7cytoolz_9functoolz_7excepts_4func_5__del__(o); } } static PyObject *__pyx_getprop_7cytoolz_9functoolz_7excepts_handler(PyObject *o, CYTHON_UNUSED void *x) { return __pyx_pw_7cytoolz_9functoolz_7excepts_7handler_1__get__(o); } static int __pyx_setprop_7cytoolz_9functoolz_7excepts_handler(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) { if (v) { return __pyx_pw_7cytoolz_9functoolz_7excepts_7handler_3__set__(o, v); } else { return __pyx_pw_7cytoolz_9functoolz_7excepts_7handler_5__del__(o); } } static PyMethodDef __pyx_methods_7cytoolz_9functoolz_excepts[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9functoolz_7excepts_5__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9functoolz_7excepts_4__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9functoolz_7excepts_7__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9functoolz_7excepts_6__setstate_cython__}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_7cytoolz_9functoolz_excepts[] = { {(char *)"__name__", __pyx_getprop_7cytoolz_9functoolz_7excepts___name__, 0, (char *)0, 0}, {(char *)"__doc__", __pyx_getprop_7cytoolz_9functoolz_7excepts___doc__, 0, (char *)0, 0}, {(char *)"exc", __pyx_getprop_7cytoolz_9functoolz_7excepts_exc, __pyx_setprop_7cytoolz_9functoolz_7excepts_exc, (char *)"exc: object", 0}, {(char *)"func", __pyx_getprop_7cytoolz_9functoolz_7excepts_func, __pyx_setprop_7cytoolz_9functoolz_7excepts_func, (char *)"func: object", 0}, {(char *)"handler", __pyx_getprop_7cytoolz_9functoolz_7excepts_handler, __pyx_setprop_7cytoolz_9functoolz_7excepts_handler, (char *)"handler: object", 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9functoolz_excepts = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.functoolz.excepts", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9functoolz_excepts), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9functoolz_excepts, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_7cytoolz_9functoolz_7excepts_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*/ "excepts(exc, func, handler=return_none)\n\n A wrapper around a function to catch exceptions and\n dispatch to a handler.\n\n This is like a functional try/except block, in the same way that\n ifexprs are functional if/else blocks.\n\n Examples\n --------\n >>> excepting = excepts(\n ... ValueError,\n ... lambda a: [1, 2].index(a),\n ... lambda _: -1,\n ... )\n >>> excepting(1)\n 0\n >>> excepting(3)\n -1\n\n Multiple exceptions and default except clause.\n >>> excepting = excepts((IndexError, KeyError), lambda a: a[0])\n >>> excepting([])\n >>> excepting([1])\n 1\n >>> excepting({})\n >>> excepting({0: 1})\n 1\n ", /*tp_doc*/ __pyx_tp_traverse_7cytoolz_9functoolz_excepts, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9functoolz_excepts, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7cytoolz_9functoolz_excepts, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_7cytoolz_9functoolz_excepts, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pw_7cytoolz_9functoolz_7excepts_1__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_7cytoolz_9functoolz_excepts, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct____get__ *__pyx_freelist_7cytoolz_9functoolz___pyx_scope_struct____get__[8]; static int __pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct____get__ = 0; static PyObject *__pyx_tp_new_7cytoolz_9functoolz___pyx_scope_struct____get__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct____get__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct____get__)))) { o = (PyObject*)__pyx_freelist_7cytoolz_9functoolz___pyx_scope_struct____get__[--__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct____get__]; memset(o, 0, sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct____get__)); (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_7cytoolz_9functoolz___pyx_scope_struct____get__(PyObject *o) { struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct____get__ *p = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct____get__ *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_self); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct____get__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct____get__)))) { __pyx_freelist_7cytoolz_9functoolz___pyx_scope_struct____get__[__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct____get__++] = ((struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct____get__ *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_7cytoolz_9functoolz___pyx_scope_struct____get__(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct____get__ *p = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct____get__ *)o; if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9functoolz___pyx_scope_struct____get__(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct____get__ *p = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct____get__ *)o; tmp = ((PyObject*)p->__pyx_v_self); p->__pyx_v_self = ((struct __pyx_obj_7cytoolz_9functoolz_Compose *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyTypeObject __pyx_type_7cytoolz_9functoolz___pyx_scope_struct____get__ = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.functoolz.__pyx_scope_struct____get__", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct____get__), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9functoolz___pyx_scope_struct____get__, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9functoolz___pyx_scope_struct____get__, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9functoolz___pyx_scope_struct____get__, /*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_7cytoolz_9functoolz___pyx_scope_struct____get__, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr *__pyx_freelist_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr[8]; static int __pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr = 0; static PyObject *__pyx_tp_new_7cytoolz_9functoolz___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_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr)))) { o = (PyObject*)__pyx_freelist_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr[--__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_7cytoolz_9functoolz___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_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr(PyObject *o) { struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_f); Py_CLEAR(p->__pyx_t_0); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr)))) { __pyx_freelist_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr[__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_7cytoolz_9functoolz___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_f) { e = (*v)(p->__pyx_v_f, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.functoolz.__pyx_scope_struct_1_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr, /*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_7cytoolz_9functoolz___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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_2___get__ *__pyx_freelist_7cytoolz_9functoolz___pyx_scope_struct_2___get__[8]; static int __pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_2___get__ = 0; static PyObject *__pyx_tp_new_7cytoolz_9functoolz___pyx_scope_struct_2___get__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_2___get__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_2___get__)))) { o = (PyObject*)__pyx_freelist_7cytoolz_9functoolz___pyx_scope_struct_2___get__[--__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_2___get__]; memset(o, 0, sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_2___get__)); (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_7cytoolz_9functoolz___pyx_scope_struct_2___get__(PyObject *o) { struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_2___get__ *p = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_2___get__ *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_composed_doc); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_2___get__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_2___get__)))) { __pyx_freelist_7cytoolz_9functoolz___pyx_scope_struct_2___get__[__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_2___get__++] = ((struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_2___get__ *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_7cytoolz_9functoolz___pyx_scope_struct_2___get__(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_2___get__ *p = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_2___get__ *)o; if (p->__pyx_v_composed_doc) { e = (*v)(p->__pyx_v_composed_doc, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9functoolz___pyx_scope_struct_2___get__(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_2___get__ *p = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_2___get__ *)o; tmp = ((PyObject*)p->__pyx_v_composed_doc); p->__pyx_v_composed_doc = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyTypeObject __pyx_type_7cytoolz_9functoolz___pyx_scope_struct_2___get__ = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.functoolz.__pyx_scope_struct_2___get__", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_2___get__), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9functoolz___pyx_scope_struct_2___get__, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9functoolz___pyx_scope_struct_2___get__, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9functoolz___pyx_scope_struct_2___get__, /*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_7cytoolz_9functoolz___pyx_scope_struct_2___get__, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_3___call__ *__pyx_freelist_7cytoolz_9functoolz___pyx_scope_struct_3___call__[8]; static int __pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_3___call__ = 0; static PyObject *__pyx_tp_new_7cytoolz_9functoolz___pyx_scope_struct_3___call__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_3___call__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_3___call__)))) { o = (PyObject*)__pyx_freelist_7cytoolz_9functoolz___pyx_scope_struct_3___call__[--__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_3___call__]; memset(o, 0, sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_3___call__)); (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_7cytoolz_9functoolz___pyx_scope_struct_3___call__(PyObject *o) { struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_3___call__ *p = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_3___call__ *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_args); Py_CLEAR(p->__pyx_v_kwargs); Py_CLEAR(p->__pyx_v_self); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_3___call__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_3___call__)))) { __pyx_freelist_7cytoolz_9functoolz___pyx_scope_struct_3___call__[__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_3___call__++] = ((struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_3___call__ *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_7cytoolz_9functoolz___pyx_scope_struct_3___call__(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_3___call__ *p = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_3___call__ *)o; if (p->__pyx_v_args) { e = (*v)(p->__pyx_v_args, a); if (e) return e; } if (p->__pyx_v_kwargs) { e = (*v)(p->__pyx_v_kwargs, a); if (e) return e; } if (p->__pyx_v_self) { e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9functoolz___pyx_scope_struct_3___call__(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_3___call__ *p = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_3___call__ *)o; tmp = ((PyObject*)p->__pyx_v_args); p->__pyx_v_args = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_kwargs); p->__pyx_v_kwargs = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_self); p->__pyx_v_self = ((struct __pyx_obj_7cytoolz_9functoolz__juxt_inner *)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyTypeObject __pyx_type_7cytoolz_9functoolz___pyx_scope_struct_3___call__ = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.functoolz.__pyx_scope_struct_3___call__", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_3___call__), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9functoolz___pyx_scope_struct_3___call__, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9functoolz___pyx_scope_struct_3___call__, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9functoolz___pyx_scope_struct_3___call__, /*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_7cytoolz_9functoolz___pyx_scope_struct_3___call__, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr *__pyx_freelist_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr[8]; static int __pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr = 0; static PyObject *__pyx_tp_new_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr)))) { o = (PyObject*)__pyx_freelist_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr[--__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_4_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_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr(PyObject *o) { struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_func); Py_CLEAR(p->__pyx_t_0); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr)))) { __pyx_freelist_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr[__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_func) { e = (*v)(p->__pyx_v_func, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.functoolz.__pyx_scope_struct_4_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr, /*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_7cytoolz_9functoolz___pyx_scope_struct_4_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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr *__pyx_freelist_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr[8]; static int __pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr = 0; static PyObject *__pyx_tp_new_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr)))) { o = (PyObject*)__pyx_freelist_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr[--__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr]; memset(o, 0, sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_5_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_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr(PyObject *o) { struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr *)o; PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_outer_scope); Py_CLEAR(p->__pyx_v_func); Py_CLEAR(p->__pyx_t_0); if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr)))) { __pyx_freelist_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr[__pyx_freecount_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr *)o); } else { (*Py_TYPE(o)->tp_free)(o); } } static int __pyx_tp_traverse_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } if (p->__pyx_v_func) { e = (*v)(p->__pyx_v_func, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; } return 0; } static PyTypeObject __pyx_type_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.functoolz.__pyx_scope_struct_5_genexpr", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr, /*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_7cytoolz_9functoolz___pyx_scope_struct_5_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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_functoolz(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_functoolz}, {0, NULL} }; #endif static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, "functoolz", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_A_composition_of_functions, __pyx_k_A_composition_of_functions, sizeof(__pyx_k_A_composition_of_functions), 0, 0, 1, 0}, {&__pyx_kp_s_A_wrapper_around_inst_func___na, __pyx_k_A_wrapper_around_inst_func___na, sizeof(__pyx_k_A_wrapper_around_inst_func___na), 0, 0, 1, 0}, {&__pyx_kp_u_Applies_a_function_and_returns, __pyx_k_Applies_a_function_and_returns, sizeof(__pyx_k_Applies_a_function_and_returns), 0, 1, 0, 0}, {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1}, {&__pyx_kp_u_Cache_a_function_s_result_for_s, __pyx_k_Cache_a_function_s_result_for_s, sizeof(__pyx_k_Cache_a_function_s_result_for_s), 0, 1, 0, 0}, {&__pyx_kp_u_Call_the_function_call_with_the, __pyx_k_Call_the_function_call_with_the, sizeof(__pyx_k_Call_the_function_call_with_the), 0, 1, 0, 0}, {&__pyx_n_s_Compose, __pyx_k_Compose, sizeof(__pyx_k_Compose), 0, 0, 1, 1}, {&__pyx_n_s_Compose___get___locals_composed, __pyx_k_Compose___get___locals_composed, sizeof(__pyx_k_Compose___get___locals_composed), 0, 0, 1, 1}, {&__pyx_n_s_Compose___get___locals_genexpr, __pyx_k_Compose___get___locals_genexpr, sizeof(__pyx_k_Compose___get___locals_genexpr), 0, 0, 1, 1}, {&__pyx_n_s_Compose___reduce, __pyx_k_Compose___reduce, sizeof(__pyx_k_Compose___reduce), 0, 0, 1, 1}, {&__pyx_n_s_Compose___setstate, __pyx_k_Compose___setstate, sizeof(__pyx_k_Compose___setstate), 0, 0, 1, 1}, {&__pyx_kp_u_Compose_functions_to_operate_in, __pyx_k_Compose_functions_to_operate_in, sizeof(__pyx_k_Compose_functions_to_operate_in), 0, 1, 0, 0}, {&__pyx_kp_u_Compose_functions_to_operate_in_2, __pyx_k_Compose_functions_to_operate_in_2, sizeof(__pyx_k_Compose_functions_to_operate_in_2), 0, 1, 0, 0}, {&__pyx_kp_u_Creates_a_function_that_calls_s, __pyx_k_Creates_a_function_that_calls_s, sizeof(__pyx_k_Creates_a_function_that_calls_s), 0, 1, 0, 0}, {&__pyx_kp_s_Incompatible_checksums_s_vs_0x75, __pyx_k_Incompatible_checksums_s_vs_0x75, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x75), 0, 0, 1, 0}, {&__pyx_kp_s_Input_must_be_callable, __pyx_k_Input_must_be_callable, sizeof(__pyx_k_Input_must_be_callable), 0, 0, 1, 0}, {&__pyx_n_s_InstanceProperty, __pyx_k_InstanceProperty, sizeof(__pyx_k_InstanceProperty), 0, 0, 1, 1}, {&__pyx_n_s_KEYWORD_ONLY, __pyx_k_KEYWORD_ONLY, sizeof(__pyx_k_KEYWORD_ONLY), 0, 0, 1, 1}, {&__pyx_n_s_MethodType, __pyx_k_MethodType, sizeof(__pyx_k_MethodType), 0, 0, 1, 1}, {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented, sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1}, {&__pyx_n_s_PY3, __pyx_k_PY3, sizeof(__pyx_k_PY3), 0, 0, 1, 1}, {&__pyx_n_s_PY34, __pyx_k_PY34, sizeof(__pyx_k_PY34), 0, 0, 1, 1}, {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {&__pyx_kp_u_Pipe_a_value_through_a_sequence, __pyx_k_Pipe_a_value_through_a_sequence, sizeof(__pyx_k_Pipe_a_value_through_a_sequence), 0, 1, 0, 0}, {&__pyx_kp_u_Runs_func_on_x_returns_x_Becaus, __pyx_k_Runs_func_on_x_returns_x_Becaus, sizeof(__pyx_k_Runs_func_on_x_returns_x_Becaus), 0, 1, 0, 0}, {&__pyx_kp_u_Thread_value_through_a_sequence, __pyx_k_Thread_value_through_a_sequence, sizeof(__pyx_k_Thread_value_through_a_sequence), 0, 1, 0, 0}, {&__pyx_kp_u_Thread_value_through_a_sequence_2, __pyx_k_Thread_value_through_a_sequence_2, sizeof(__pyx_k_Thread_value_through_a_sequence_2), 0, 1, 0, 0}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_VAR_KEYWORD, __pyx_k_VAR_KEYWORD, sizeof(__pyx_k_VAR_KEYWORD), 0, 0, 1, 1}, {&__pyx_n_s_VAR_POSITIONAL, __pyx_k_VAR_POSITIONAL, sizeof(__pyx_k_VAR_POSITIONAL), 0, 0, 1, 1}, {&__pyx_kp_s__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 0}, {&__pyx_n_s__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 0, 1, 1}, {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0}, {&__pyx_kp_s__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 1, 0}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, {&__pyx_n_s_apply, __pyx_k_apply, sizeof(__pyx_k_apply), 0, 0, 1, 1}, {&__pyx_kp_u_apply_line_34, __pyx_k_apply_line_34, sizeof(__pyx_k_apply_line_34), 0, 1, 0, 0}, {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1}, {&__pyx_kp_s_args_kwargs, __pyx_k_args_kwargs, sizeof(__pyx_k_args_kwargs), 0, 0, 1, 0}, {&__pyx_n_s_attr, __pyx_k_attr, sizeof(__pyx_k_attr), 0, 0, 1, 1}, {&__pyx_n_s_attrgetter, __pyx_k_attrgetter, sizeof(__pyx_k_attrgetter), 0, 0, 1, 1}, {&__pyx_n_s_attrs, __pyx_k_attrs, sizeof(__pyx_k_attrs), 0, 0, 1, 1}, {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, {&__pyx_n_s_bind, __pyx_k_bind, sizeof(__pyx_k_bind), 0, 0, 1, 1}, {&__pyx_n_s_cache, __pyx_k_cache, sizeof(__pyx_k_cache), 0, 0, 1, 1}, {&__pyx_n_s_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 0, 1, 1}, {&__pyx_n_s_call___locals_genexpr, __pyx_k_call___locals_genexpr, sizeof(__pyx_k_call___locals_genexpr), 0, 0, 1, 1}, {&__pyx_kp_s_class_____name___r, __pyx_k_class_____name___r, sizeof(__pyx_k_class_____name___r), 0, 0, 1, 0}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 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_complement, __pyx_k_complement, sizeof(__pyx_k_complement), 0, 0, 1, 1}, {&__pyx_n_s_complement___reduce, __pyx_k_complement___reduce, sizeof(__pyx_k_complement___reduce), 0, 0, 1, 1}, {&__pyx_n_s_compose, __pyx_k_compose, sizeof(__pyx_k_compose), 0, 0, 1, 1}, {&__pyx_n_s_compose_left, __pyx_k_compose_left, sizeof(__pyx_k_compose_left), 0, 0, 1, 1}, {&__pyx_kp_u_compose_left_line_619, __pyx_k_compose_left_line_619, sizeof(__pyx_k_compose_left_line_619), 0, 1, 0, 0}, {&__pyx_kp_u_compose_line_588, __pyx_k_compose_line_588, sizeof(__pyx_k_compose_line_588), 0, 1, 0, 0}, {&__pyx_n_s_composed_doc, __pyx_k_composed_doc, sizeof(__pyx_k_composed_doc), 0, 0, 1, 1}, {&__pyx_kp_s_curry, __pyx_k_curry, sizeof(__pyx_k_curry), 0, 0, 1, 0}, {&__pyx_n_s_curry_2, __pyx_k_curry_2, sizeof(__pyx_k_curry_2), 0, 0, 1, 1}, {&__pyx_n_s_curry___reduce, __pyx_k_curry___reduce, sizeof(__pyx_k_curry___reduce), 0, 0, 1, 1}, {&__pyx_n_s_curry__should_curry, __pyx_k_curry__should_curry, sizeof(__pyx_k_curry__should_curry), 0, 0, 1, 1}, {&__pyx_n_s_curry__should_curry_internal, __pyx_k_curry__should_curry_internal, sizeof(__pyx_k_curry__should_curry_internal), 0, 0, 1, 1}, {&__pyx_n_s_curry_bind, __pyx_k_curry_bind, sizeof(__pyx_k_curry_bind), 0, 0, 1, 1}, {&__pyx_n_s_curry_call, __pyx_k_curry_call, sizeof(__pyx_k_curry_call), 0, 0, 1, 1}, {&__pyx_kp_s_curry_object_has_incorrect_argum, __pyx_k_curry_object_has_incorrect_argum, sizeof(__pyx_k_curry_object_has_incorrect_argum), 0, 0, 1, 0}, {&__pyx_n_s_cytoolz__signatures, __pyx_k_cytoolz__signatures, sizeof(__pyx_k_cytoolz__signatures), 0, 0, 1, 1}, {&__pyx_n_s_cytoolz_compatibility, __pyx_k_cytoolz_compatibility, sizeof(__pyx_k_cytoolz_compatibility), 0, 0, 1, 1}, {&__pyx_n_s_cytoolz_functoolz, __pyx_k_cytoolz_functoolz, sizeof(__pyx_k_cytoolz_functoolz), 0, 0, 1, 1}, {&__pyx_kp_s_cytoolz_functoolz_pyx, __pyx_k_cytoolz_functoolz_pyx, sizeof(__pyx_k_cytoolz_functoolz_pyx), 0, 0, 1, 0}, {&__pyx_n_s_cytoolz_utils, __pyx_k_cytoolz_utils, sizeof(__pyx_k_cytoolz_utils), 0, 0, 1, 1}, {&__pyx_kp_s_cytooz_functoolz, __pyx_k_cytooz_functoolz, sizeof(__pyx_k_cytooz_functoolz), 0, 0, 1, 0}, {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1}, {&__pyx_n_s_dedent, __pyx_k_dedent, sizeof(__pyx_k_dedent), 0, 0, 1, 1}, {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, {&__pyx_n_s_do, __pyx_k_do, sizeof(__pyx_k_do), 0, 0, 1, 1}, {&__pyx_kp_u_do_line_737, __pyx_k_do_line_737, sizeof(__pyx_k_do_line_737), 0, 1, 0, 0}, {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, {&__pyx_n_s_exc, __pyx_k_exc, sizeof(__pyx_k_exc), 0, 0, 1, 1}, {&__pyx_n_s_excepting, __pyx_k_excepting, sizeof(__pyx_k_excepting), 0, 0, 1, 1}, {&__pyx_n_s_excepts, __pyx_k_excepts, sizeof(__pyx_k_excepts), 0, 0, 1, 1}, {&__pyx_n_s_excepts___reduce_cython, __pyx_k_excepts___reduce_cython, sizeof(__pyx_k_excepts___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_excepts___setstate_cython, __pyx_k_excepts___setstate_cython, sizeof(__pyx_k_excepts___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1}, {&__pyx_kp_s_f_g, __pyx_k_f_g, sizeof(__pyx_k_f_g), 0, 0, 1, 0}, {&__pyx_n_s_filter, __pyx_k_filter, sizeof(__pyx_k_filter), 0, 0, 1, 1}, {&__pyx_n_s_first, __pyx_k_first, sizeof(__pyx_k_first), 0, 0, 1, 1}, {&__pyx_n_s_flip, __pyx_k_flip, sizeof(__pyx_k_flip), 0, 0, 1, 1}, {&__pyx_n_s_flip_2, __pyx_k_flip_2, sizeof(__pyx_k_flip_2), 0, 0, 1, 1}, {&__pyx_kp_u_flip_line_764, __pyx_k_flip_line_764, sizeof(__pyx_k_flip_line_764), 0, 1, 0, 0}, {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1}, {&__pyx_n_s_forms, __pyx_k_forms, sizeof(__pyx_k_forms), 0, 0, 1, 1}, {&__pyx_n_s_fs, __pyx_k_fs, sizeof(__pyx_k_fs), 0, 0, 1, 1}, {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, {&__pyx_n_s_func_and_args, __pyx_k_func_and_args, sizeof(__pyx_k_func_and_args), 0, 0, 1, 1}, {&__pyx_kp_s_func_argument_is_required, __pyx_k_func_argument_is_required, sizeof(__pyx_k_func_argument_is_required), 0, 0, 1, 0}, {&__pyx_n_s_funcs, __pyx_k_funcs, sizeof(__pyx_k_funcs), 0, 0, 1, 1}, {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1}, {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1}, {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_handler, __pyx_k_handler, sizeof(__pyx_k_handler), 0, 0, 1, 1}, {&__pyx_n_s_has_keywords, __pyx_k_has_keywords, sizeof(__pyx_k_has_keywords), 0, 0, 1, 1}, {&__pyx_n_s_has_varargs, __pyx_k_has_varargs, sizeof(__pyx_k_has_varargs), 0, 0, 1, 1}, {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1}, {&__pyx_n_s_identity, __pyx_k_identity, sizeof(__pyx_k_identity), 0, 0, 1, 1}, {&__pyx_n_s_ifilter, __pyx_k_ifilter, sizeof(__pyx_k_ifilter), 0, 0, 1, 1}, {&__pyx_n_s_imap, __pyx_k_imap, sizeof(__pyx_k_imap), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_import_module, __pyx_k_import_module, sizeof(__pyx_k_import_module), 0, 0, 1, 1}, {&__pyx_kp_s_init___takes_at_least_2_argume, __pyx_k_init___takes_at_least_2_argume, sizeof(__pyx_k_init___takes_at_least_2_argume), 0, 0, 1, 0}, {&__pyx_n_s_inspect, __pyx_k_inspect, sizeof(__pyx_k_inspect), 0, 0, 1, 1}, {&__pyx_n_s_inst, __pyx_k_inst, sizeof(__pyx_k_inst), 0, 0, 1, 1}, {&__pyx_n_s_instanceproperty, __pyx_k_instanceproperty, sizeof(__pyx_k_instanceproperty), 0, 0, 1, 1}, {&__pyx_n_s_is_arity, __pyx_k_is_arity, sizeof(__pyx_k_is_arity), 0, 0, 1, 1}, {&__pyx_n_s_is_decorated, __pyx_k_is_decorated, sizeof(__pyx_k_is_decorated), 0, 0, 1, 1}, {&__pyx_n_s_is_partial_args, __pyx_k_is_partial_args, sizeof(__pyx_k_is_partial_args), 0, 0, 1, 1}, {&__pyx_n_s_is_valid_args, __pyx_k_is_valid_args, sizeof(__pyx_k_is_valid_args), 0, 0, 1, 1}, {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_juxt, __pyx_k_juxt, sizeof(__pyx_k_juxt), 0, 0, 1, 1}, {&__pyx_n_s_juxt_inner, __pyx_k_juxt_inner, sizeof(__pyx_k_juxt_inner), 0, 0, 1, 1}, {&__pyx_n_s_juxt_inner___reduce, __pyx_k_juxt_inner___reduce, sizeof(__pyx_k_juxt_inner___reduce), 0, 0, 1, 1}, {&__pyx_kp_u_juxt_line_715, __pyx_k_juxt_line_715, sizeof(__pyx_k_juxt_line_715), 0, 1, 0, 0}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_n_s_keywords, __pyx_k_keywords, sizeof(__pyx_k_keywords), 0, 0, 1, 1}, {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1}, {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1}, {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1}, {&__pyx_kp_s_lambda_args_kwargs, __pyx_k_lambda_args_kwargs, sizeof(__pyx_k_lambda_args_kwargs), 0, 0, 1, 0}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1}, {&__pyx_n_s_memoize, __pyx_k_memoize, sizeof(__pyx_k_memoize), 0, 0, 1, 1}, {&__pyx_n_s_memoize_2, __pyx_k_memoize_2, sizeof(__pyx_k_memoize_2), 0, 0, 1, 1}, {&__pyx_n_s_memoize___reduce_cython, __pyx_k_memoize___reduce_cython, sizeof(__pyx_k_memoize___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_memoize___setstate_cython, __pyx_k_memoize___setstate_cython, sizeof(__pyx_k_memoize___setstate_cython), 0, 0, 1, 1}, {&__pyx_kp_u_memoize_line_391, __pyx_k_memoize_line_391, sizeof(__pyx_k_memoize_line_391), 0, 1, 0, 0}, {&__pyx_n_s_modname, __pyx_k_modname, sizeof(__pyx_k_modname), 0, 0, 1, 1}, {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 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_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, {&__pyx_n_s_no_default, __pyx_k_no_default, sizeof(__pyx_k_no_default), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_num_required_args, __pyx_k_num_required_args, sizeof(__pyx_k_num_required_args), 0, 0, 1, 1}, {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, {&__pyx_n_s_of, __pyx_k_of, sizeof(__pyx_k_of), 0, 0, 1, 1}, {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1}, {&__pyx_n_s_or, __pyx_k_or, sizeof(__pyx_k_or), 0, 0, 1, 1}, {&__pyx_n_s_parameters, __pyx_k_parameters, sizeof(__pyx_k_parameters), 0, 0, 1, 1}, {&__pyx_n_s_partial, __pyx_k_partial, sizeof(__pyx_k_partial), 0, 0, 1, 1}, {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_n_s_pipe, __pyx_k_pipe, sizeof(__pyx_k_pipe), 0, 0, 1, 1}, {&__pyx_kp_u_pipe_line_648, __pyx_k_pipe_line_648, sizeof(__pyx_k_pipe_line_648), 0, 1, 0, 0}, {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle_excepts, __pyx_k_pyx_unpickle_excepts, sizeof(__pyx_k_pyx_unpickle_excepts), 0, 0, 1, 1}, {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, {&__pyx_n_s_qualname_2, __pyx_k_qualname_2, sizeof(__pyx_k_qualname_2), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_2, __pyx_k_reduce_2, sizeof(__pyx_k_reduce_2), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, {&__pyx_n_s_restore_curry, __pyx_k_restore_curry, sizeof(__pyx_k_restore_curry), 0, 0, 1, 1}, {&__pyx_n_s_return_annotation, __pyx_k_return_annotation, sizeof(__pyx_k_return_annotation), 0, 0, 1, 1}, {&__pyx_n_s_return_none, __pyx_k_return_none, sizeof(__pyx_k_return_none), 0, 0, 1, 1}, {&__pyx_n_s_reversed, __pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 0, 1, 1}, {&__pyx_n_s_rsplit, __pyx_k_rsplit, sizeof(__pyx_k_rsplit), 0, 0, 1, 1}, {&__pyx_kp_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 0}, {&__pyx_kp_s_s_excepting__s, __pyx_k_s_excepting__s, sizeof(__pyx_k_s_excepting__s), 0, 0, 1, 0}, {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0}, {&__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_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_should_curry, __pyx_k_should_curry, sizeof(__pyx_k_should_curry), 0, 0, 1, 1}, {&__pyx_n_s_should_curry_internal, __pyx_k_should_curry_internal, sizeof(__pyx_k_should_curry_internal), 0, 0, 1, 1}, {&__pyx_n_s_signature, __pyx_k_signature, sizeof(__pyx_k_signature), 0, 0, 1, 1}, {&__pyx_n_s_signature_or_spec, __pyx_k_signature_or_spec, sizeof(__pyx_k_signature_or_spec), 0, 0, 1, 1}, {&__pyx_n_s_sigs, __pyx_k_sigs, sizeof(__pyx_k_sigs), 0, 0, 1, 1}, {&__pyx_n_s_sigspec, __pyx_k_sigspec, sizeof(__pyx_k_sigspec), 0, 0, 1, 1}, {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__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_n_s_textwrap, __pyx_k_textwrap, sizeof(__pyx_k_textwrap), 0, 0, 1, 1}, {&__pyx_n_s_thread_first, __pyx_k_thread_first, sizeof(__pyx_k_thread_first), 0, 0, 1, 1}, {&__pyx_kp_u_thread_first_line_65, __pyx_k_thread_first_line_65, sizeof(__pyx_k_thread_first_line_65), 0, 1, 0, 0}, {&__pyx_n_s_thread_last, __pyx_k_thread_last, sizeof(__pyx_k_thread_last), 0, 0, 1, 1}, {&__pyx_kp_u_thread_last_line_107, __pyx_k_thread_last_line_107, sizeof(__pyx_k_thread_last_line_107), 0, 1, 0, 0}, {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1}, {&__pyx_n_s_toolz_functoolz, __pyx_k_toolz_functoolz, sizeof(__pyx_k_toolz_functoolz), 0, 0, 1, 1}, {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1}, {&__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_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 47, __pyx_L1_error) __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 238, __pyx_L1_error) __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_n_s_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(0, 499, __pyx_L1_error) __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 521, __pyx_L1_error) __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 555, __pyx_L1_error) __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(0, 847, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "cytoolz/functoolz.pyx":47 * """ * if not func_and_args: * raise TypeError('func argument is required') # <<<<<<<<<<<<<< * return func_and_args[0](*func_and_args[1:], **kwargs) * */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_func_argument_is_required); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 47, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "cytoolz/functoolz.pyx":58 * val = form(val) * elif PyTuple_Check(form): * func, args = form[0], (val,) + form[1:] # <<<<<<<<<<<<<< * val = PyObject_CallObject(func, args) * else: */ __pyx_slice__2 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__2)) __PYX_ERR(0, 58, __pyx_L1_error) __Pyx_GOTREF(__pyx_slice__2); __Pyx_GIVEREF(__pyx_slice__2); /* "cytoolz/functoolz.pyx":191 * def __cinit__(self, *args, **kwargs): * if not args: * raise TypeError('__init__() takes at least 2 arguments (1 given)') # <<<<<<<<<<<<<< * func, args = args[0], args[1:] * if not PyCallable_Check(func): */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_init___takes_at_least_2_argume); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "cytoolz/functoolz.pyx":194 * func, args = args[0], args[1:] * if not PyCallable_Check(func): * raise TypeError("Input must be callable") # <<<<<<<<<<<<<< * * # curry- or functools.partial-like object? Unpack and merge arguments */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Input_must_be_callable); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "cytoolz/functoolz.pyx":319 * keywords = self.keywords or {} * if is_partial_args(self.func, args, keywords, sig) is False: * raise TypeError('curry object has incorrect arguments') # <<<<<<<<<<<<<< * * params = list(sig.parameters.values()) */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_curry_object_has_incorrect_argum); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "cytoolz/functoolz.pyx":380 * cpdef object _restore_curry(cls, func, args, kwargs, is_decorated): * if isinstance(func, str): * modname, qualname = func.rsplit(':', 1) # <<<<<<<<<<<<<< * obj = import_module(modname) * for attr in qualname.split('.'): */ __pyx_tuple__8 = PyTuple_Pack(2, __pyx_kp_s__7, __pyx_int_1); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* "cytoolz/functoolz.pyx":560 * property __doc__: * def __get__(self): * def composed_doc(*fs): # <<<<<<<<<<<<<< * """Generate a docstring for the composition of fs. * """ */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_n_s_fs); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_composed_doc, 560, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 560, __pyx_L1_error) /* "cytoolz/functoolz.pyx":30 * * * cpdef object identity(object x): # <<<<<<<<<<<<<< * return x * */ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_identity, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 30, __pyx_L1_error) /* "cytoolz/functoolz.pyx":34 * * * def apply(*func_and_args, **kwargs): # <<<<<<<<<<<<<< * """ * Applies a function and returns the results */ __pyx_tuple__18 = PyTuple_Pack(2, __pyx_n_s_func_and_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_apply, 34, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 34, __pyx_L1_error) /* "cytoolz/functoolz.pyx":65 * * * def thread_first(val, *forms): # <<<<<<<<<<<<<< * """ * Thread value through a sequence of functions/forms */ __pyx_tuple__20 = PyTuple_Pack(2, __pyx_n_s_val, __pyx_n_s_forms); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_thread_first, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 65, __pyx_L1_error) /* "cytoolz/functoolz.pyx":107 * * * def thread_last(val, *forms): # <<<<<<<<<<<<<< * """ * Thread value through a sequence of functions/forms */ __pyx_tuple__22 = PyTuple_Pack(2, __pyx_n_s_val, __pyx_n_s_forms); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_thread_last, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 107, __pyx_L1_error) /* "cytoolz/functoolz.pyx":256 * raise * * def _should_curry(self, args, kwargs, exc=None): # <<<<<<<<<<<<<< * if PyTuple_GET_SIZE(args) == 0: * args = self.args */ __pyx_tuple__24 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_exc); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_should_curry, 256, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 256, __pyx_L1_error) /* "cytoolz/functoolz.pyx":265 * return self._should_curry_internal(args, kwargs) * * def _should_curry_internal(self, args, kwargs, exc=None): # <<<<<<<<<<<<<< * func = self.func * */ __pyx_tuple__26 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_exc, __pyx_n_s_func, __pyx_n_s_sigspec); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_should_curry_internal, 265, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 265, __pyx_L1_error) /* "cytoolz/functoolz.pyx":294 * return False * * def bind(self, *args, **kwargs): # <<<<<<<<<<<<<< * return type(self)(self, *args, **kwargs) * */ __pyx_tuple__28 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_bind, 294, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 294, __pyx_L1_error) /* "cytoolz/functoolz.pyx":297 * return type(self)(self, *args, **kwargs) * * def call(self, *args, **kwargs): # <<<<<<<<<<<<<< * cdef object val * */ __pyx_tuple__30 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_val); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_call, 297, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 297, __pyx_L1_error) /* "cytoolz/functoolz.pyx":351 * return sig.replace(parameters=newparams) * * def __reduce__(self): # <<<<<<<<<<<<<< * func = self.func * modname = getattr(func, '__module__', None) */ __pyx_tuple__32 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_func, __pyx_n_s_modname, __pyx_n_s_qualname_2, __pyx_n_s_is_decorated, __pyx_n_s_attrs, __pyx_n_s_obj, __pyx_n_s_attr, __pyx_n_s_state); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_reduce, 351, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 351, __pyx_L1_error) /* "cytoolz/functoolz.pyx":378 * * * cpdef object _restore_curry(cls, func, args, kwargs, is_decorated): # <<<<<<<<<<<<<< * if isinstance(func, str): * modname, qualname = func.rsplit(':', 1) */ __pyx_tuple__34 = PyTuple_Pack(5, __pyx_n_s_cls, __pyx_n_s_func, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_is_decorated); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_restore_curry, 378, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 378, __pyx_L1_error) /* "cytoolz/functoolz.pyx":391 * * * cpdef object memoize(object func, object cache=None, object key=None): # <<<<<<<<<<<<<< * """ * Cache a function's result for speedy future evaluation */ __pyx_tuple__36 = PyTuple_Pack(3, __pyx_n_s_func, __pyx_n_s_cache, __pyx_n_s_key); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_memoize_2, 391, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 391, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__38); __Pyx_GIVEREF(__pyx_tuple__38); __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(1, 3, __pyx_L1_error) /* "cytoolz/functoolz.pyx":508 * return ret * * def __reduce__(self): # <<<<<<<<<<<<<< * return (Compose, (self.first,), self.funcs) * */ __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_reduce, 508, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 508, __pyx_L1_error) /* "cytoolz/functoolz.pyx":511 * return (Compose, (self.first,), self.funcs) * * def __setstate__(self, state): # <<<<<<<<<<<<<< * self.funcs = state * */ __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_state); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__44); __Pyx_GIVEREF(__pyx_tuple__44); __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_setstate, 511, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 511, __pyx_L1_error) /* "cytoolz/functoolz.pyx":588 * * * def compose(*funcs): # <<<<<<<<<<<<<< * """ * Compose functions to operate in series. */ __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_s_funcs); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__46); __Pyx_GIVEREF(__pyx_tuple__46); __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_compose, 588, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 588, __pyx_L1_error) /* "cytoolz/functoolz.pyx":619 * * * def compose_left(*funcs): # <<<<<<<<<<<<<< * """ * Compose functions to operate in series. */ __pyx_tuple__48 = PyTuple_Pack(1, __pyx_n_s_funcs); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__48); __Pyx_GIVEREF(__pyx_tuple__48); __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_compose_left, 619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 619, __pyx_L1_error) /* "cytoolz/functoolz.pyx":648 * * * def pipe(data, *funcs): # <<<<<<<<<<<<<< * """ * Pipe a value through a sequence of functions */ __pyx_tuple__50 = PyTuple_Pack(2, __pyx_n_s_data, __pyx_n_s_funcs); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__50); __Pyx_GIVEREF(__pyx_tuple__50); __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_pipe, 648, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 648, __pyx_L1_error) /* "cytoolz/functoolz.pyx":693 * return not PyObject_Call(self.func, args, kwargs) # use PyObject_Not? * * def __reduce__(self): # <<<<<<<<<<<<<< * return (complement, (self.func,)) * */ __pyx_tuple__52 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__52); __Pyx_GIVEREF(__pyx_tuple__52); __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_reduce, 693, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 693, __pyx_L1_error) /* "cytoolz/functoolz.pyx":707 * return tuple(PyObject_CallObject(func, args) for func in self.funcs) * * def __reduce__(self): # <<<<<<<<<<<<<< * return (_juxt_inner, (self.funcs,)) * */ __pyx_tuple__54 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_reduce, 707, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 707, __pyx_L1_error) /* "cytoolz/functoolz.pyx":715 * * * def juxt(*funcs): # <<<<<<<<<<<<<< * """ * Creates a function that calls several functions with the same arguments */ __pyx_tuple__56 = PyTuple_Pack(1, __pyx_n_s_funcs); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56); __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_juxt, 715, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 715, __pyx_L1_error) /* "cytoolz/functoolz.pyx":737 * * * cpdef object do(object func, object x): # <<<<<<<<<<<<<< * """ * Runs ``func`` on ``x``, returns ``x`` */ __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_s_func, __pyx_n_s_x); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__58); __Pyx_GIVEREF(__pyx_tuple__58); __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_do, 737, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 737, __pyx_L1_error) /* "cytoolz/functoolz.pyx":764 * * * cpdef object flip(object func, object a, object b): # <<<<<<<<<<<<<< * """ * Call the function call with the arguments flipped */ __pyx_tuple__60 = PyTuple_Pack(3, __pyx_n_s_func, __pyx_n_s_a, __pyx_n_s_b); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__60); __Pyx_GIVEREF(__pyx_tuple__60); __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_flip, 764, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 764, __pyx_L1_error) /* "cytoolz/functoolz.pyx":794 * * * cpdef object return_none(object exc): # <<<<<<<<<<<<<< * """ * Returns None. */ __pyx_tuple__62 = PyTuple_Pack(1, __pyx_n_s_exc); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__62); __Pyx_GIVEREF(__pyx_tuple__62); __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_functoolz_pyx, __pyx_n_s_return_none, 794, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 794, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_tuple__64 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__64); __Pyx_GIVEREF(__pyx_tuple__64); __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: * return __pyx_unpickle_excepts, (type(self), 0x75ac63f, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_excepts__set_state(self, __pyx_state) */ __pyx_tuple__66 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__66); __Pyx_GIVEREF(__pyx_tuple__66); __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(1, 16, __pyx_L1_error) /* "(tree fragment)":1 * def __pyx_unpickle_excepts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_tuple__68 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__68); __Pyx_GIVEREF(__pyx_tuple__68); __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_excepts, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { __pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type; if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_123389503 = PyInt_FromLong(123389503L); if (unlikely(!__pyx_int_123389503)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __pyx_v_7cytoolz_9functoolz__partial = Py_None; Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ if (__Pyx_ExportFunction("identity", (void (*)(void))__pyx_f_7cytoolz_9functoolz_identity, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("c_thread_first", (void (*)(void))__pyx_f_7cytoolz_9functoolz_c_thread_first, "PyObject *(PyObject *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("c_thread_last", (void (*)(void))__pyx_f_7cytoolz_9functoolz_c_thread_last, "PyObject *(PyObject *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("memoize", (void (*)(void))__pyx_f_7cytoolz_9functoolz_memoize, "PyObject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9functoolz_memoize *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("c_compose", (void (*)(void))__pyx_f_7cytoolz_9functoolz_c_compose, "PyObject *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("c_compose_left", (void (*)(void))__pyx_f_7cytoolz_9functoolz_c_compose_left, "PyObject *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("c_pipe", (void (*)(void))__pyx_f_7cytoolz_9functoolz_c_pipe, "PyObject *(PyObject *, PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("c_juxt", (void (*)(void))__pyx_f_7cytoolz_9functoolz_c_juxt, "PyObject *(PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("do", (void (*)(void))__pyx_f_7cytoolz_9functoolz_do, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("flip", (void (*)(void))__pyx_f_7cytoolz_9functoolz_flip, "PyObject *(PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("return_none", (void (*)(void))__pyx_f_7cytoolz_9functoolz_return_none, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_7cytoolz_9functoolz_curry) < 0) __PYX_ERR(0, 158, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9functoolz_curry.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9functoolz_curry.tp_dictoffset && __pyx_type_7cytoolz_9functoolz_curry.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9functoolz_curry.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_curry_2, (PyObject *)&__pyx_type_7cytoolz_9functoolz_curry) < 0) __PYX_ERR(0, 158, __pyx_L1_error) __pyx_ptype_7cytoolz_9functoolz_curry = &__pyx_type_7cytoolz_9functoolz_curry; if (PyType_Ready(&__pyx_type_7cytoolz_9functoolz__memoize) < 0) __PYX_ERR(0, 431, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9functoolz__memoize.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9functoolz__memoize.tp_dictoffset && __pyx_type_7cytoolz_9functoolz__memoize.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9functoolz__memoize.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_memoize, (PyObject *)&__pyx_type_7cytoolz_9functoolz__memoize) < 0) __PYX_ERR(0, 431, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9functoolz__memoize) < 0) __PYX_ERR(0, 431, __pyx_L1_error) __pyx_ptype_7cytoolz_9functoolz__memoize = &__pyx_type_7cytoolz_9functoolz__memoize; if (PyType_Ready(&__pyx_type_7cytoolz_9functoolz_Compose) < 0) __PYX_ERR(0, 486, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9functoolz_Compose.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9functoolz_Compose.tp_dictoffset && __pyx_type_7cytoolz_9functoolz_Compose.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9functoolz_Compose.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Compose, (PyObject *)&__pyx_type_7cytoolz_9functoolz_Compose) < 0) __PYX_ERR(0, 486, __pyx_L1_error) __pyx_ptype_7cytoolz_9functoolz_Compose = &__pyx_type_7cytoolz_9functoolz_Compose; if (PyType_Ready(&__pyx_type_7cytoolz_9functoolz_complement) < 0) __PYX_ERR(0, 672, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9functoolz_complement.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9functoolz_complement.tp_dictoffset && __pyx_type_7cytoolz_9functoolz_complement.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9functoolz_complement.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_complement, (PyObject *)&__pyx_type_7cytoolz_9functoolz_complement) < 0) __PYX_ERR(0, 672, __pyx_L1_error) __pyx_ptype_7cytoolz_9functoolz_complement = &__pyx_type_7cytoolz_9functoolz_complement; if (PyType_Ready(&__pyx_type_7cytoolz_9functoolz__juxt_inner) < 0) __PYX_ERR(0, 697, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9functoolz__juxt_inner.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9functoolz__juxt_inner.tp_dictoffset && __pyx_type_7cytoolz_9functoolz__juxt_inner.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9functoolz__juxt_inner.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_juxt_inner, (PyObject *)&__pyx_type_7cytoolz_9functoolz__juxt_inner) < 0) __PYX_ERR(0, 697, __pyx_L1_error) __pyx_ptype_7cytoolz_9functoolz__juxt_inner = &__pyx_type_7cytoolz_9functoolz__juxt_inner; if (PyType_Ready(&__pyx_type_7cytoolz_9functoolz_excepts) < 0) __PYX_ERR(0, 801, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9functoolz_excepts.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9functoolz_excepts.tp_dictoffset && __pyx_type_7cytoolz_9functoolz_excepts.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9functoolz_excepts.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_excepts, (PyObject *)&__pyx_type_7cytoolz_9functoolz_excepts) < 0) __PYX_ERR(0, 801, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9functoolz_excepts) < 0) __PYX_ERR(0, 801, __pyx_L1_error) __pyx_ptype_7cytoolz_9functoolz_excepts = &__pyx_type_7cytoolz_9functoolz_excepts; if (PyType_Ready(&__pyx_type_7cytoolz_9functoolz___pyx_scope_struct____get__) < 0) __PYX_ERR(0, 550, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9functoolz___pyx_scope_struct____get__.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9functoolz___pyx_scope_struct____get__.tp_dictoffset && __pyx_type_7cytoolz_9functoolz___pyx_scope_struct____get__.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9functoolz___pyx_scope_struct____get__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_7cytoolz_9functoolz___pyx_scope_struct____get__ = &__pyx_type_7cytoolz_9functoolz___pyx_scope_struct____get__; if (PyType_Ready(&__pyx_type_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 553, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr.tp_dictoffset && __pyx_type_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr = &__pyx_type_7cytoolz_9functoolz___pyx_scope_struct_1_genexpr; if (PyType_Ready(&__pyx_type_7cytoolz_9functoolz___pyx_scope_struct_2___get__) < 0) __PYX_ERR(0, 559, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9functoolz___pyx_scope_struct_2___get__.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9functoolz___pyx_scope_struct_2___get__.tp_dictoffset && __pyx_type_7cytoolz_9functoolz___pyx_scope_struct_2___get__.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9functoolz___pyx_scope_struct_2___get__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_7cytoolz_9functoolz___pyx_scope_struct_2___get__ = &__pyx_type_7cytoolz_9functoolz___pyx_scope_struct_2___get__; if (PyType_Ready(&__pyx_type_7cytoolz_9functoolz___pyx_scope_struct_3___call__) < 0) __PYX_ERR(0, 701, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9functoolz___pyx_scope_struct_3___call__.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9functoolz___pyx_scope_struct_3___call__.tp_dictoffset && __pyx_type_7cytoolz_9functoolz___pyx_scope_struct_3___call__.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9functoolz___pyx_scope_struct_3___call__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_7cytoolz_9functoolz___pyx_scope_struct_3___call__ = &__pyx_type_7cytoolz_9functoolz___pyx_scope_struct_3___call__; if (PyType_Ready(&__pyx_type_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 703, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr.tp_dictoffset && __pyx_type_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr = &__pyx_type_7cytoolz_9functoolz___pyx_scope_struct_4_genexpr; if (PyType_Ready(&__pyx_type_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 705, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr.tp_dictoffset && __pyx_type_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } __pyx_ptype_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr = &__pyx_type_7cytoolz_9functoolz___pyx_scope_struct_5_genexpr; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), #else sizeof(PyHeapTypeObject), #endif __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION < 3 #ifdef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC void #else #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #endif #else #ifdef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyObject * #else #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initfunctoolz(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initfunctoolz(void) #else __Pyx_PyMODINIT_FUNC PyInit_functoolz(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_functoolz(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { result = PyDict_SetItemString(moddict, to_name, value); } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_functoolz(PyObject *__pyx_pyinit_module) #endif #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'functoolz' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif #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("__Pyx_PyMODINIT_FUNC PyInit_functoolz(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __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 CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("functoolz", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __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_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_cytoolz__functoolz) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "cytoolz.functoolz")) { if (unlikely(PyDict_SetItemString(modules, "cytoolz.functoolz", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error; /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error; /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "cytoolz/functoolz.pyx":1 * import inspect # <<<<<<<<<<<<<< * import sys * from functools import partial */ __pyx_t_1 = __Pyx_patch_inspect(__Pyx_Import(__pyx_n_s_inspect, 0, -1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_inspect, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":2 * import inspect * import sys # <<<<<<<<<<<<<< * from functools import partial * from operator import attrgetter */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":3 * import inspect * import sys * from functools import partial # <<<<<<<<<<<<<< * from operator import attrgetter * from textwrap import dedent */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_partial); __Pyx_GIVEREF(__pyx_n_s_partial); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_partial); __pyx_t_2 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __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_partial); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_partial, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/functoolz.pyx":4 * import sys * from functools import partial * from operator import attrgetter # <<<<<<<<<<<<<< * from textwrap import dedent * from types import MethodType */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_attrgetter); __Pyx_GIVEREF(__pyx_n_s_attrgetter); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_attrgetter); __pyx_t_1 = __Pyx_Import(__pyx_n_s_operator, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __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_attrgetter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_attrgetter, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":5 * from functools import partial * from operator import attrgetter * from textwrap import dedent # <<<<<<<<<<<<<< * from types import MethodType * from cytoolz.utils import no_default */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_dedent); __Pyx_GIVEREF(__pyx_n_s_dedent); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_dedent); __pyx_t_2 = __Pyx_Import(__pyx_n_s_textwrap, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __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_dedent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_dedent, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/functoolz.pyx":6 * from operator import attrgetter * from textwrap import dedent * from types import MethodType # <<<<<<<<<<<<<< * from cytoolz.utils import no_default * from cytoolz.compatibility import PY3, PY34, filter as ifilter, map as imap, reduce, import_module */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_MethodType); __Pyx_GIVEREF(__pyx_n_s_MethodType); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_MethodType); __pyx_t_1 = __Pyx_Import(__pyx_n_s_types, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __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_MethodType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_MethodType, __pyx_t_2) < 0) __PYX_ERR(0, 6, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":7 * from textwrap import dedent * from types import MethodType * from cytoolz.utils import no_default # <<<<<<<<<<<<<< * from cytoolz.compatibility import PY3, PY34, filter as ifilter, map as imap, reduce, import_module * import cytoolz._signatures as _sigs */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_no_default); __Pyx_GIVEREF(__pyx_n_s_no_default); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_no_default); __pyx_t_2 = __Pyx_Import(__pyx_n_s_cytoolz_utils, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __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_no_default); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_no_default, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/functoolz.pyx":8 * from types import MethodType * from cytoolz.utils import no_default * from cytoolz.compatibility import PY3, PY34, filter as ifilter, map as imap, reduce, import_module # <<<<<<<<<<<<<< * import cytoolz._signatures as _sigs * */ __pyx_t_2 = PyList_New(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_PY3); __Pyx_GIVEREF(__pyx_n_s_PY3); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PY3); __Pyx_INCREF(__pyx_n_s_PY34); __Pyx_GIVEREF(__pyx_n_s_PY34); PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_PY34); __Pyx_INCREF(__pyx_n_s_filter); __Pyx_GIVEREF(__pyx_n_s_filter); PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_filter); __Pyx_INCREF(__pyx_n_s_map); __Pyx_GIVEREF(__pyx_n_s_map); PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_map); __Pyx_INCREF(__pyx_n_s_reduce_2); __Pyx_GIVEREF(__pyx_n_s_reduce_2); PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_reduce_2); __Pyx_INCREF(__pyx_n_s_import_module); __Pyx_GIVEREF(__pyx_n_s_import_module); PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_s_import_module); __pyx_t_1 = __Pyx_Import(__pyx_n_s_cytoolz_compatibility, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __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_PY3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PY3, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_PY34); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_PY34, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_filter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_ifilter, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_imap, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_reduce_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_2, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_import_module); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_module, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":9 * from cytoolz.utils import no_default * from cytoolz.compatibility import PY3, PY34, filter as ifilter, map as imap, reduce, import_module * import cytoolz._signatures as _sigs # <<<<<<<<<<<<<< * * from toolz.functoolz import (InstanceProperty, instanceproperty, is_arity, */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s__15); __Pyx_GIVEREF(__pyx_n_s__15); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s__15); __pyx_t_2 = __Pyx_Import(__pyx_n_s_cytoolz__signatures, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __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_sigs, __pyx_t_2) < 0) __PYX_ERR(0, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/functoolz.pyx":11 * import cytoolz._signatures as _sigs * * from toolz.functoolz import (InstanceProperty, instanceproperty, is_arity, # <<<<<<<<<<<<<< * num_required_args, has_varargs, has_keywords, * is_valid_args, is_partial_args) */ __pyx_t_2 = PyList_New(8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_InstanceProperty); __Pyx_GIVEREF(__pyx_n_s_InstanceProperty); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_InstanceProperty); __Pyx_INCREF(__pyx_n_s_instanceproperty); __Pyx_GIVEREF(__pyx_n_s_instanceproperty); PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_instanceproperty); __Pyx_INCREF(__pyx_n_s_is_arity); __Pyx_GIVEREF(__pyx_n_s_is_arity); PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_is_arity); __Pyx_INCREF(__pyx_n_s_num_required_args); __Pyx_GIVEREF(__pyx_n_s_num_required_args); PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_num_required_args); __Pyx_INCREF(__pyx_n_s_has_varargs); __Pyx_GIVEREF(__pyx_n_s_has_varargs); PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_has_varargs); __Pyx_INCREF(__pyx_n_s_has_keywords); __Pyx_GIVEREF(__pyx_n_s_has_keywords); PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_s_has_keywords); __Pyx_INCREF(__pyx_n_s_is_valid_args); __Pyx_GIVEREF(__pyx_n_s_is_valid_args); PyList_SET_ITEM(__pyx_t_2, 6, __pyx_n_s_is_valid_args); __Pyx_INCREF(__pyx_n_s_is_partial_args); __Pyx_GIVEREF(__pyx_n_s_is_partial_args); PyList_SET_ITEM(__pyx_t_2, 7, __pyx_n_s_is_partial_args); __pyx_t_1 = __Pyx_Import(__pyx_n_s_toolz_functoolz, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __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_InstanceProperty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_InstanceProperty, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_instanceproperty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_instanceproperty, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_is_arity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_arity, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_num_required_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_num_required_args, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_has_varargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_has_varargs, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_has_keywords); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_has_keywords, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_is_valid_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_valid_args, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_is_partial_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_partial_args, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":25 * * * __all__ = ['identity', 'thread_first', 'thread_last', 'memoize', 'compose', 'compose_left', # <<<<<<<<<<<<<< * 'pipe', 'complement', 'juxt', 'do', 'curry', 'memoize', 'flip', * 'excepts', 'apply'] */ __pyx_t_1 = PyList_New(15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_identity); __Pyx_GIVEREF(__pyx_n_s_identity); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_identity); __Pyx_INCREF(__pyx_n_s_thread_first); __Pyx_GIVEREF(__pyx_n_s_thread_first); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_thread_first); __Pyx_INCREF(__pyx_n_s_thread_last); __Pyx_GIVEREF(__pyx_n_s_thread_last); PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_thread_last); __Pyx_INCREF(__pyx_n_s_memoize_2); __Pyx_GIVEREF(__pyx_n_s_memoize_2); PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_memoize_2); __Pyx_INCREF(__pyx_n_s_compose); __Pyx_GIVEREF(__pyx_n_s_compose); PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_compose); __Pyx_INCREF(__pyx_n_s_compose_left); __Pyx_GIVEREF(__pyx_n_s_compose_left); PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_compose_left); __Pyx_INCREF(__pyx_n_s_pipe); __Pyx_GIVEREF(__pyx_n_s_pipe); PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_pipe); __Pyx_INCREF(__pyx_n_s_complement); __Pyx_GIVEREF(__pyx_n_s_complement); PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_s_complement); __Pyx_INCREF(__pyx_n_s_juxt); __Pyx_GIVEREF(__pyx_n_s_juxt); PyList_SET_ITEM(__pyx_t_1, 8, __pyx_n_s_juxt); __Pyx_INCREF(__pyx_n_s_do); __Pyx_GIVEREF(__pyx_n_s_do); PyList_SET_ITEM(__pyx_t_1, 9, __pyx_n_s_do); __Pyx_INCREF(__pyx_n_s_curry_2); __Pyx_GIVEREF(__pyx_n_s_curry_2); PyList_SET_ITEM(__pyx_t_1, 10, __pyx_n_s_curry_2); __Pyx_INCREF(__pyx_n_s_memoize_2); __Pyx_GIVEREF(__pyx_n_s_memoize_2); PyList_SET_ITEM(__pyx_t_1, 11, __pyx_n_s_memoize_2); __Pyx_INCREF(__pyx_n_s_flip); __Pyx_GIVEREF(__pyx_n_s_flip); PyList_SET_ITEM(__pyx_t_1, 12, __pyx_n_s_flip); __Pyx_INCREF(__pyx_n_s_excepts); __Pyx_GIVEREF(__pyx_n_s_excepts); PyList_SET_ITEM(__pyx_t_1, 13, __pyx_n_s_excepts); __Pyx_INCREF(__pyx_n_s_apply); __Pyx_GIVEREF(__pyx_n_s_apply); PyList_SET_ITEM(__pyx_t_1, 14, __pyx_n_s_apply); if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":30 * * * cpdef object identity(object x): # <<<<<<<<<<<<<< * return x * */ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_1identity, 0, __pyx_n_s_identity, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_identity, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":34 * * * def apply(*func_and_args, **kwargs): # <<<<<<<<<<<<<< * """ * Applies a function and returns the results */ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_3apply, 0, __pyx_n_s_apply, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_apply, __pyx_t_1) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":65 * * * def thread_first(val, *forms): # <<<<<<<<<<<<<< * """ * Thread value through a sequence of functions/forms */ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_5thread_first, 0, __pyx_n_s_thread_first, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_thread_first, __pyx_t_1) < 0) __PYX_ERR(0, 65, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":107 * * * def thread_last(val, *forms): # <<<<<<<<<<<<<< * """ * Thread value through a sequence of functions/forms */ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_7thread_last, 0, __pyx_n_s_thread_last, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_thread_last, __pyx_t_1) < 0) __PYX_ERR(0, 107, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/functoolz.pyx":149 * * * cdef object _partial = partial(lambda: None) # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_partial); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_26lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __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_XGOTREF(__pyx_v_7cytoolz_9functoolz__partial); __Pyx_DECREF_SET(__pyx_v_7cytoolz_9functoolz__partial, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":256 * raise * * def _should_curry(self, args, kwargs, exc=None): # <<<<<<<<<<<<<< * if PyTuple_GET_SIZE(args) == 0: * args = self.args */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_5curry_13_should_curry, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_curry__should_curry, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_7cytoolz_9functoolz_curry->tp_dict, __pyx_n_s_should_curry, __pyx_t_3) < 0) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_7cytoolz_9functoolz_curry); /* "cytoolz/functoolz.pyx":265 * return self._should_curry_internal(args, kwargs) * * def _should_curry_internal(self, args, kwargs, exc=None): # <<<<<<<<<<<<<< * func = self.func * */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_5curry_15_should_curry_internal, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_curry__should_curry_internal, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_7cytoolz_9functoolz_curry->tp_dict, __pyx_n_s_should_curry_internal, __pyx_t_3) < 0) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_7cytoolz_9functoolz_curry); /* "cytoolz/functoolz.pyx":294 * return False * * def bind(self, *args, **kwargs): # <<<<<<<<<<<<<< * return type(self)(self, *args, **kwargs) * */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_5curry_17bind, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_curry_bind, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_7cytoolz_9functoolz_curry->tp_dict, __pyx_n_s_bind, __pyx_t_3) < 0) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_7cytoolz_9functoolz_curry); /* "cytoolz/functoolz.pyx":297 * return type(self)(self, *args, **kwargs) * * def call(self, *args, **kwargs): # <<<<<<<<<<<<<< * cdef object val * */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_5curry_19call, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_curry_call, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_7cytoolz_9functoolz_curry->tp_dict, __pyx_n_s_call, __pyx_t_3) < 0) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_7cytoolz_9functoolz_curry); /* "cytoolz/functoolz.pyx":351 * return sig.replace(parameters=newparams) * * def __reduce__(self): # <<<<<<<<<<<<<< * func = self.func * modname = getattr(func, '__module__', None) */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_5curry_23__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_curry___reduce, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_7cytoolz_9functoolz_curry->tp_dict, __pyx_n_s_reduce, __pyx_t_3) < 0) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_7cytoolz_9functoolz_curry); /* "cytoolz/functoolz.pyx":378 * * * cpdef object _restore_curry(cls, func, args, kwargs, is_decorated): # <<<<<<<<<<<<<< * if isinstance(func, str): * modname, qualname = func.rsplit(':', 1) */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_9_restore_curry, 0, __pyx_n_s_restore_curry, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_restore_curry, __pyx_t_3) < 0) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":391 * * * cpdef object memoize(object func, object cache=None, object key=None): # <<<<<<<<<<<<<< * """ * Cache a function's result for speedy future evaluation */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_11memoize, 0, __pyx_n_s_memoize_2, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_memoize_2, __pyx_t_3) < 0) __PYX_ERR(0, 391, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_8_memoize_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_memoize___reduce_cython, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_8_memoize_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_memoize___setstate_cython, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":495 * """ * # fix for #103, note: we cannot use __name__ at module-scope in cython * __module__ = 'cytooz.functoolz' # <<<<<<<<<<<<<< * * def __cinit__(self, *funcs): */ if (PyDict_SetItem((PyObject *)__pyx_ptype_7cytoolz_9functoolz_Compose->tp_dict, __pyx_n_s_module, __pyx_kp_s_cytooz_functoolz) < 0) __PYX_ERR(0, 495, __pyx_L1_error) PyType_Modified(__pyx_ptype_7cytoolz_9functoolz_Compose); /* "cytoolz/functoolz.pyx":508 * return ret * * def __reduce__(self): # <<<<<<<<<<<<<< * return (Compose, (self.first,), self.funcs) * */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_7Compose_5__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Compose___reduce, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_7cytoolz_9functoolz_Compose->tp_dict, __pyx_n_s_reduce, __pyx_t_3) < 0) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_7cytoolz_9functoolz_Compose); /* "cytoolz/functoolz.pyx":511 * return (Compose, (self.first,), self.funcs) * * def __setstate__(self, state): # <<<<<<<<<<<<<< * self.funcs = state * */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_7Compose_7__setstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Compose___setstate, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_7cytoolz_9functoolz_Compose->tp_dict, __pyx_n_s_setstate, __pyx_t_3) < 0) __PYX_ERR(0, 511, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_7cytoolz_9functoolz_Compose); /* "cytoolz/functoolz.pyx":588 * * * def compose(*funcs): # <<<<<<<<<<<<<< * """ * Compose functions to operate in series. */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_13compose, 0, __pyx_n_s_compose, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_compose, __pyx_t_3) < 0) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":619 * * * def compose_left(*funcs): # <<<<<<<<<<<<<< * """ * Compose functions to operate in series. */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_15compose_left, 0, __pyx_n_s_compose_left, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_compose_left, __pyx_t_3) < 0) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":648 * * * def pipe(data, *funcs): # <<<<<<<<<<<<<< * """ * Pipe a value through a sequence of functions */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_17pipe, 0, __pyx_n_s_pipe, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pipe, __pyx_t_3) < 0) __PYX_ERR(0, 648, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":693 * return not PyObject_Call(self.func, args, kwargs) # use PyObject_Not? * * def __reduce__(self): # <<<<<<<<<<<<<< * return (complement, (self.func,)) * */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_10complement_5__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_complement___reduce, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_7cytoolz_9functoolz_complement->tp_dict, __pyx_n_s_reduce, __pyx_t_3) < 0) __PYX_ERR(0, 693, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_7cytoolz_9functoolz_complement); /* "cytoolz/functoolz.pyx":707 * return tuple(PyObject_CallObject(func, args) for func in self.funcs) * * def __reduce__(self): # <<<<<<<<<<<<<< * return (_juxt_inner, (self.funcs,)) * */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_11_juxt_inner_5__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_juxt_inner___reduce, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem((PyObject *)__pyx_ptype_7cytoolz_9functoolz__juxt_inner->tp_dict, __pyx_n_s_reduce, __pyx_t_3) < 0) __PYX_ERR(0, 707, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; PyType_Modified(__pyx_ptype_7cytoolz_9functoolz__juxt_inner); /* "cytoolz/functoolz.pyx":715 * * * def juxt(*funcs): # <<<<<<<<<<<<<< * """ * Creates a function that calls several functions with the same arguments */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_19juxt, 0, __pyx_n_s_juxt, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_juxt, __pyx_t_3) < 0) __PYX_ERR(0, 715, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":737 * * * cpdef object do(object func, object x): # <<<<<<<<<<<<<< * """ * Runs ``func`` on ``x``, returns ``x`` */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_21do, 0, __pyx_n_s_do, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_do, __pyx_t_3) < 0) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":764 * * * cpdef object flip(object func, object a, object b): # <<<<<<<<<<<<<< * """ * Call the function call with the arguments flipped */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_23flip, 0, __pyx_n_s_flip, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_flip, __pyx_t_3) < 0) __PYX_ERR(0, 764, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":791 * * * _flip = flip # uncurried # <<<<<<<<<<<<<< * * */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_flip); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_flip_2, __pyx_t_3) < 0) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":794 * * * cpdef object return_none(object exc): # <<<<<<<<<<<<<< * """ * Returns None. */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_25return_none, 0, __pyx_n_s_return_none, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_return_none, __pyx_t_3) < 0) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":831 * """ * * def __init__(self, exc, func, handler=return_none): # <<<<<<<<<<<<<< * self.exc = exc * self.func = func */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_return_none); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_k__13 = __pyx_t_3; __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_7excepts_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_excepts___reduce_cython, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle_excepts, (type(self), 0x75ac63f, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_excepts__set_state(self, __pyx_state) */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_7excepts_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_excepts___setstate_cython, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_3) < 0) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":1 * def __pyx_unpickle_excepts(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9functoolz_28__pyx_unpickle_excepts, 0, __pyx_n_s_pyx_unpickle_excepts, NULL, __pyx_n_s_cytoolz_functoolz, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_excepts, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/functoolz.pyx":1 * import inspect # <<<<<<<<<<<<<< * import sys * from functools import partial */ __pyx_t_3 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_kp_u_apply_line_34, __pyx_kp_u_Applies_a_function_and_returns) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_kp_u_thread_first_line_65, __pyx_kp_u_Thread_value_through_a_sequence) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_kp_u_thread_last_line_107, __pyx_kp_u_Thread_value_through_a_sequence_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_kp_u_memoize_line_391, __pyx_kp_u_Cache_a_function_s_result_for_s) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_kp_u_compose_line_588, __pyx_kp_u_Compose_functions_to_operate_in) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_kp_u_compose_left_line_619, __pyx_kp_u_Compose_functions_to_operate_in_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_kp_u_pipe_line_648, __pyx_kp_u_Pipe_a_value_through_a_sequence) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_kp_u_juxt_line_715, __pyx_kp_u_Creates_a_function_that_calls_s) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_kp_u_do_line_737, __pyx_kp_u_Runs_func_on_x_returns_x_Becaus) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_3, __pyx_kp_u_flip_line_764, __pyx_kp_u_Call_the_function_call_with_the) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init cytoolz.functoolz", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_CLEAR(__pyx_m); } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init cytoolz.functoolz"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS 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); } #endif /* GetBuiltinName */ 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; } /* KeywordStringCheck */ static 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_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; } /* PyObjectCall */ #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 (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; 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); } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare 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 (PyType_Check(type)) { #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; 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; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else 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) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } 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 (cause) { 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) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* GetItemInt */ static 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, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_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, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_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, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(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(__Pyx_is_valid_index(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)) return NULL; PyErr_Clear(); } } 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)); } /* SliceTupleAndList */ #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 /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { PyCFunctionObject *func = (PyCFunctionObject*)func_obj; PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyObject *self = PyCFunction_GET_SELF(func); int flags = PyCFunction_GET_FLAGS(func); assert(PyCFunction_Check(func)); assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); assert(nargs >= 0); assert(nargs == 0 || args != NULL); /* _PyCFunction_FastCallDict() must not be called with an exception set, because it may clear it (directly or indirectly) and so the caller loses its exception */ assert(!PyErr_Occurred()); if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); } else { return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); } } #endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { return NULL; } if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif #endif /* PyObjectCall2Args */ static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args, *result = NULL; #if CYTHON_FAST_PYCALL if (PyFunction_Check(function)) { PyObject *args[2] = {arg1, arg2}; return __Pyx_PyFunction_FastCall(function, args, 2); } #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(function)) { PyObject *args[2] = {arg1, arg2}; return __Pyx_PyCFunction_FastCall(function, args, 2); } #endif args = PyTuple_New(2); if (unlikely(!args)) goto done; Py_INCREF(arg1); PyTuple_SET_ITEM(args, 0, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 1, arg2); Py_INCREF(function); result = __Pyx_PyObject_Call(function, args, NULL); Py_DECREF(args); Py_DECREF(function); done: return result; } /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallOneArg */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif if (likely(PyCFunction_Check(func))) { if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { return __Pyx_PyCFunction_FastCall(func, &arg, 1); #endif } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif /* SliceObject */ 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_USE_TYPE_SLOTS 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)) goto bad; PyErr_Clear(); } } 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_USE_TYPE_SLOTS 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; } /* RaiseDoubleKeywords */ 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 } /* ParseKeywords */ 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; } /* RaiseArgTupleInvalid */ 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); } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #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); } /* HasAttr */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!__Pyx_PyBaseString_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } r = __Pyx_GetAttr(o, n); if (unlikely(!r)) { PyErr_Clear(); return 0; } else { Py_DECREF(r); return 1; } } /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; icurexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; if (unlikely(PyTuple_Check(err))) return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #endif /* GetAttr3 */ static PyObject *__Pyx_GetAttr3Default(PyObject *d) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(d); return d; } static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r = __Pyx_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); } /* pyfrozenset_new */ static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) { if (it) { PyObject* result; #if CYTHON_COMPILING_IN_PYPY PyObject* args; args = PyTuple_Pack(1, it); if (unlikely(!args)) return NULL; result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL); Py_DECREF(args); return result; #else 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); #endif } #if CYTHON_USE_TYPE_SLOTS return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL); #else return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL); #endif } /* UnpackUnboundCMethod */ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { PyObject *method; method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); if (unlikely(!method)) return -1; target->method = method; #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject*) method; target->func = descr->d_method->ml_meth; target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); } #endif return 0; } /* CallUnboundCMethod0 */ static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { PyObject *args, *result = NULL; if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_ASSUME_SAFE_MACROS args = PyTuple_New(1); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); #else args = PyTuple_Pack(1, self); if (unlikely(!args)) goto bad; #endif result = __Pyx_PyObject_Call(cfunc->method, args, NULL); Py_DECREF(args); bad: return result; } /* py_dict_items */ static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) { if (PY_MAJOR_VERSION >= 3) return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_items, d); else return PyDict_Items(d); } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; #endif Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else 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; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type, *local_value, *local_tb; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; 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_FAST_THREAD_STATE 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_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; } #else 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; #endif 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; } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyObjectCallNoArg */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) #else if (likely(PyCFunction_Check(func))) #endif { if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) { (void)inplace; (void)zerodivision_check; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_CheckExact(op1))) { const long b = intval; long x; long a = PyInt_AS_LONG(op1); x = (long)((unsigned long)a + b); if (likely((x^a) >= 0 || (x^b) >= 0)) return PyInt_FromLong(x); return PyLong_Type.tp_as_number->nb_add(op1, op2); } #endif #if CYTHON_USE_PYLONG_INTERNALS if (likely(PyLong_CheckExact(op1))) { const long b = intval; long a, x; #ifdef HAVE_LONG_LONG const PY_LONG_LONG llb = intval; PY_LONG_LONG lla, llx; #endif const digit* digits = ((PyLongObject*)op1)->ob_digit; const Py_ssize_t size = Py_SIZE(op1); if (likely(__Pyx_sst_abs(size) <= 1)) { a = likely(size) ? digits[0] : 0; if (size == -1) a = -a; } else { switch (size) { case -2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 2: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 3: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case -4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; case 4: if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); break; #ifdef HAVE_LONG_LONG } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) { lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])); goto long_long; #endif } CYTHON_FALLTHROUGH; default: return PyLong_Type.tp_as_number->nb_add(op1, op2); } } x = a + b; return PyLong_FromLong(x); #ifdef HAVE_LONG_LONG long_long: llx = lla + llb; return PyLong_FromLongLong(llx); #endif } #endif if (PyFloat_CheckExact(op1)) { const long b = intval; double a = PyFloat_AS_DOUBLE(op1); double result; PyFPE_START_PROTECT("add", return NULL) result = ((double)a) + (double)b; PyFPE_END_PROTECT(result) return PyFloat_FromDouble(result); } return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2); } #endif /* DictGetItem */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) { if (unlikely(PyTuple_Check(key))) { PyObject* args = PyTuple_Pack(1, key); if (likely(args)) { PyErr_SetObject(PyExc_KeyError, args); Py_DECREF(args); } } else { PyErr_SetObject(PyExc_KeyError, key); } } return NULL; } Py_INCREF(value); return value; } #endif /* StringJoin */ #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 /* RaiseTooManyValuesToUnpack */ 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); } /* RaiseNeedMoreValuesToUnpack */ 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"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(__Pyx_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 } /* UnpackItemEndCheck */ 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; } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { PyObject *runerr; Py_ssize_t key_value; PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; if (unlikely(!(m && m->sq_item))) { PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); return NULL; } key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; if (likely(m && m->mp_subscript)) { return m->mp_subscript(obj, key); } return __Pyx_PyObject_GetIndex(obj, key); } #endif /* None */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); } /* FetchCommonType */ 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; } /* CythonFunction */ #include 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, CYTHON_UNUSED void *context) { PyObject *tmp = op->func_doc; if (value == NULL) { value = Py_None; } Py_INCREF(value); op->func_doc = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 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); #else op->defaults_tuple = PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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} }; static PyMemberDef __pyx_CyFunction_members[] = { {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, 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[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif 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; __Pyx_CyFunction_weakreflist(op) = 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]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); PyObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(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 __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); } if (obj == Py_None) obj = NULL; return __Pyx_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 } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; Py_ssize_t size; switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 0)) return (*meth)(self, NULL); PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d 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 (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d 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; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; argc = PyTuple_GET_SIZE(args); new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, 0, 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_CyFunction_descr_get, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 0, #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, #endif }; static int __pyx_CyFunction_init(void) { __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); if (unlikely(__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 = PyObject_Malloc(size); if (unlikely(!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); } /* Import */ 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_MAJOR_VERSION < 3 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_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } /* ImportFrom */ 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; } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'%.50s' object has no attribute '%U'", tp->tp_name, attr_name); #else "'%.50s' object has no attribute '%.400s'", tp->tp_name, PyString_AS_STRING(attr_name)); #endif return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; #if CYTHON_USE_PYTYPE_LOOKUP if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD; #else if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD; #endif #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD; ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD; setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD; ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD; } PyType_Modified((PyTypeObject*)type_obj); } } goto GOOD; BAD: if (!PyErr_Occurred()) PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); ret = -1; GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif result = PyObject_GetAttrString(module, class_name); 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 ((size_t)basicsize < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* PatchModuleWithCoroutine */ static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) int result; PyObject *globals, *result_obj; globals = PyDict_New(); if (unlikely(!globals)) goto ignore; result = PyDict_SetItemString(globals, "_cython_coroutine_type", #ifdef __Pyx_Coroutine_USED (PyObject*)__pyx_CoroutineType); #else Py_None); #endif if (unlikely(result < 0)) goto ignore; result = PyDict_SetItemString(globals, "_cython_generator_type", #ifdef __Pyx_Generator_USED (PyObject*)__pyx_GeneratorType); #else Py_None); #endif if (unlikely(result < 0)) goto ignore; if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore; if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore; result_obj = PyRun_String(py_code, Py_file_input, globals, globals); if (unlikely(!result_obj)) goto ignore; Py_DECREF(result_obj); Py_DECREF(globals); return module; ignore: Py_XDECREF(globals); PyErr_WriteUnraisable(module); if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) { Py_DECREF(module); module = NULL; } #else py_code++; #endif return module; } /* PatchInspect */ static PyObject* __Pyx_patch_inspect(PyObject* module) { #if defined(__Pyx_Generator_USED) && (!defined(CYTHON_PATCH_INSPECT) || CYTHON_PATCH_INSPECT) static int inspect_patched = 0; if (unlikely((!inspect_patched) && module)) { module = __Pyx_Coroutine_patch_module( module, "" "old_types = getattr(_module.isgenerator, '_cython_generator_types', None)\n" "if old_types is None or not isinstance(old_types, set):\n" " old_types = set()\n" " def cy_wrap(orig_func, type=type, cython_generator_types=old_types):\n" " def cy_isgenerator(obj): return type(obj) in cython_generator_types or orig_func(obj)\n" " cy_isgenerator._cython_generator_types = cython_generator_types\n" " return cy_isgenerator\n" " _module.isgenerator = cy_wrap(_module.isgenerator)\n" "old_types.add(_cython_generator_type)\n" ); inspect_patched = 1; } #else if ((0)) return __Pyx_Coroutine_patch_module(module, NULL); #endif return module; } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ 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 - start) / 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); } /* AddTraceback */ #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, 0, 0, 0, 0, __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, __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; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } 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_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 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); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 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(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #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_IntOrLong(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_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 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(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #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_IntOrLong(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_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = a->tp_base; if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; if (!res) { res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } return res; } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; iexc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = *type; exc_info->exc_value = *value; exc_info->exc_traceback = *tb; #else 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; #endif *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #else static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb); PyErr_SetExcInfo(*type, *value, *tb); *type = tmp_type; *value = tmp_value; *tb = tmp_tb; } #endif /* PyObjectGetMethod */ static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) { PyObject *attr; #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP PyTypeObject *tp = Py_TYPE(obj); PyObject *descr; descrgetfunc f = NULL; PyObject **dictptr, *dict; int meth_found = 0; assert (*method == NULL); if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) { attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; } if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) { return 0; } descr = _PyType_Lookup(tp, name); if (likely(descr != NULL)) { Py_INCREF(descr); #if PY_MAJOR_VERSION >= 3 #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type))) #endif #else #ifdef __Pyx_CyFunction_USED if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr))) #else if (likely(PyFunction_Check(descr))) #endif #endif { meth_found = 1; } else { f = Py_TYPE(descr)->tp_descr_get; if (f != NULL && PyDescr_IsData(descr)) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } } } dictptr = _PyObject_GetDictPtr(obj); if (dictptr != NULL && (dict = *dictptr) != NULL) { Py_INCREF(dict); attr = __Pyx_PyDict_GetItemStr(dict, name); if (attr != NULL) { Py_INCREF(attr); Py_DECREF(dict); Py_XDECREF(descr); goto try_unpack; } Py_DECREF(dict); } if (meth_found) { *method = descr; return 1; } if (f != NULL) { attr = f(descr, obj, (PyObject *)Py_TYPE(obj)); Py_DECREF(descr); goto try_unpack; } if (descr != NULL) { *method = descr; return 0; } PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'%.50s' object has no attribute '%U'", tp->tp_name, name); #else "'%.50s' object has no attribute '%.400s'", tp->tp_name, PyString_AS_STRING(name)); #endif return 0; #else attr = __Pyx_PyObject_GetAttrStr(obj, name); goto try_unpack; #endif try_unpack: #if CYTHON_UNPACK_METHODS if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) { PyObject *function = PyMethod_GET_FUNCTION(attr); Py_INCREF(function); Py_DECREF(attr); *method = function; return 1; } #endif *method = attr; return 0; } /* PyObjectCallMethod1 */ static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) { PyObject *result = __Pyx_PyObject_CallOneArg(method, arg); Py_DECREF(method); return result; } static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) { PyObject *method = NULL, *result; int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method); if (likely(is_method)) { result = __Pyx_PyObject_Call2Args(method, obj, arg); Py_DECREF(method); return result; } if (unlikely(!method)) return NULL; return __Pyx__PyObject_CallMethod1(method, arg); } /* CoroutineBase */ #include #include #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom) static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, 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 (likely(et == PyExc_StopIteration)) { if (!ev) { Py_INCREF(Py_None); value = Py_None; } #if PY_VERSION_HEX >= 0x030300A0 else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) { value = ((PyStopIterationObject *)ev)->value; Py_INCREF(value); Py_DECREF(ev); } #endif else if (unlikely(PyTuple_Check(ev))) { if (PyTuple_GET_SIZE(ev) >= 1) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS value = PyTuple_GET_ITEM(ev, 0); Py_INCREF(value); #else value = PySequence_ITEM(ev, 0); #endif } else { Py_INCREF(Py_None); value = Py_None; } Py_DECREF(ev); } else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) { value = ev; } if (likely(value)) { Py_XDECREF(tb); Py_DECREF(et); *pvalue = value; return 0; } } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) { __Pyx_ErrRestore(et, ev, tb); return -1; } PyErr_NormalizeException(&et, &ev, &tb); if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)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 = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args); Py_DECREF(ev); if (likely(args)) { value = PySequence_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; } static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) { PyObject *t, *v, *tb; t = exc_state->exc_type; v = exc_state->exc_value; tb = exc_state->exc_traceback; exc_state->exc_type = NULL; exc_state->exc_value = NULL; exc_state->exc_traceback = NULL; Py_XDECREF(t); Py_XDECREF(v); Py_XDECREF(tb); } #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL) static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) { const char *msg; if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check((PyObject*)gen)) { msg = "coroutine already executing"; #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) { msg = "async generator already executing"; #endif } else { msg = "generator already executing"; } PyErr_SetString(PyExc_ValueError, msg); } #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL) static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) { const char *msg; if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check(gen)) { msg = "can't send non-None value to a just-started coroutine"; #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(gen)) { msg = "can't send non-None value to a just-started async generator"; #endif } else { msg = "can't send non-None value to a just-started generator"; } PyErr_SetString(PyExc_TypeError, msg); } #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL) static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) { #ifdef __Pyx_Coroutine_USED if (!closing && __Pyx_Coroutine_Check(gen)) { PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine"); } else #endif if (value) { #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration); else #endif PyErr_SetNone(PyExc_StopIteration); } } static PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) { __Pyx_PyThreadState_declare PyThreadState *tstate; __Pyx_ExcInfoStruct *exc_state; PyObject *retval; assert(!self->is_running); if (unlikely(self->resume_label == 0)) { if (unlikely(value && value != Py_None)) { return __Pyx_Coroutine_NotStartedError((PyObject*)self); } } if (unlikely(self->resume_label == -1)) { return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing); } #if CYTHON_FAST_THREAD_STATE __Pyx_PyThreadState_assign tstate = __pyx_tstate; #else tstate = __Pyx_PyThreadState_Current; #endif exc_state = &self->gi_exc_state; if (exc_state->exc_type) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON #else if (exc_state->exc_traceback) { PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback; PyFrameObject *f = tb->tb_frame; Py_XINCREF(tstate->frame); assert(f->f_back == NULL); f->f_back = tstate->frame; } #endif } #if CYTHON_USE_EXC_INFO_STACK exc_state->previous_item = tstate->exc_info; tstate->exc_info = exc_state; #else if (exc_state->exc_type) { __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); } else { __Pyx_Coroutine_ExceptionClear(exc_state); __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback); } #endif self->is_running = 1; retval = self->body((PyObject *) self, tstate, value); self->is_running = 0; #if CYTHON_USE_EXC_INFO_STACK exc_state = &self->gi_exc_state; tstate->exc_info = exc_state->previous_item; exc_state->previous_item = NULL; __Pyx_Coroutine_ResetFrameBackpointer(exc_state); #endif return retval; } static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) { PyObject *exc_tb = exc_state->exc_traceback; if (likely(exc_tb)) { #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON #else PyTracebackObject *tb = (PyTracebackObject *) exc_tb; PyFrameObject *f = tb->tb_frame; Py_CLEAR(f->f_back); #endif } } static CYTHON_INLINE PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) { if (unlikely(!retval)) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (!__Pyx_PyErr_Occurred()) { PyObject *exc = PyExc_StopIteration; #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(gen)) exc = __Pyx_PyExc_StopAsyncIteration; #endif __Pyx_PyErr_SetNone(exc); } } return retval; } static CYTHON_INLINE PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) { PyObject *ret; PyObject *val = NULL; __Pyx_Coroutine_Undelegate(gen); __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val); ret = __Pyx_Coroutine_SendEx(gen, val, 0); Py_XDECREF(val); return ret; } static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) { PyObject *retval; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; PyObject *yf = gen->yieldfrom; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { PyObject *ret; gen->is_running = 1; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Coroutine_Send(yf, value); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { ret = __Pyx_Coroutine_Send(yf, value); } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { ret = __Pyx_async_gen_asend_send(yf, value); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyGen_CheckExact(yf)) { ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyCoro_CheckExact(yf)) { ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value); } else #endif { if (value == Py_None) ret = Py_TYPE(yf)->tp_iternext(yf); else ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value); } gen->is_running = 0; if (likely(ret)) { return ret; } retval = __Pyx_Coroutine_FinishDelegation(gen); } else { retval = __Pyx_Coroutine_SendEx(gen, value, 0); } return __Pyx_Coroutine_MethodReturn(self, retval); } static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) { PyObject *retval = NULL; int err = 0; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { retval = __Pyx_Coroutine_Close(yf); if (!retval) return -1; } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { retval = __Pyx_Coroutine_Close(yf); if (!retval) return -1; } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL); if (!retval) return -1; } else #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_PyAsyncGenASend_CheckExact(yf)) { retval = __Pyx_async_gen_asend_close(yf, NULL); } else if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) { retval = __Pyx_async_gen_athrow_close(yf, NULL); } else #endif { PyObject *meth; gen->is_running = 1; meth = __Pyx_PyObject_GetAttrStr(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_Next(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self; PyObject *yf = gen->yieldfrom; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { PyObject *ret; gen->is_running = 1; #ifdef __Pyx_Generator_USED if (__Pyx_Generator_CheckExact(yf)) { ret = __Pyx_Generator_Next(yf); } else #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3) if (PyGen_CheckExact(yf)) { ret = _PyGen_Send((PyGenObject*)yf, NULL); } else #endif #ifdef __Pyx_Coroutine_USED if (__Pyx_Coroutine_Check(yf)) { ret = __Pyx_Coroutine_Send(yf, Py_None); } else #endif ret = Py_TYPE(yf)->tp_iternext(yf); gen->is_running = 0; if (likely(ret)) { return ret; } return __Pyx_Coroutine_FinishDelegation(gen); } return __Pyx_Coroutine_SendEx(gen, Py_None, 0); } static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) { return __Pyx_Coroutine_Close(self); } static PyObject *__Pyx_Coroutine_Close(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject *retval, *raised_exception; PyObject *yf = gen->yieldfrom; int err = 0; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { Py_INCREF(yf); err = __Pyx_Coroutine_CloseIter(gen, yf); __Pyx_Coroutine_Undelegate(gen); Py_DECREF(yf); } if (err == 0) PyErr_SetNone(PyExc_GeneratorExit); retval = __Pyx_Coroutine_SendEx(gen, NULL, 1); if (unlikely(retval)) { const char *msg; Py_DECREF(retval); if ((0)) { #ifdef __Pyx_Coroutine_USED } else if (__Pyx_Coroutine_Check(self)) { msg = "coroutine ignored GeneratorExit"; #endif #ifdef __Pyx_AsyncGen_USED } else if (__Pyx_AsyncGen_CheckExact(self)) { #if PY_VERSION_HEX < 0x03060000 msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)"; #else msg = "async generator ignored GeneratorExit"; #endif #endif } else { msg = "generator ignored GeneratorExit"; } PyErr_SetString(PyExc_RuntimeError, msg); return NULL; } raised_exception = PyErr_Occurred(); if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) { if (raised_exception) PyErr_Clear(); Py_INCREF(Py_None); return Py_None; } return NULL; } static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb, PyObject *args, int close_on_genexit) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; PyObject *yf = gen->yieldfrom; if (unlikely(gen->is_running)) return __Pyx_Coroutine_AlreadyRunningError(gen); if (yf) { PyObject *ret; Py_INCREF(yf); if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) { int err = __Pyx_Coroutine_CloseIter(gen, yf); Py_DECREF(yf); __Pyx_Coroutine_Undelegate(gen); if (err < 0) return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); goto throw_here; } gen->is_running = 1; if (0 #ifdef __Pyx_Generator_USED || __Pyx_Generator_CheckExact(yf) #endif #ifdef __Pyx_Coroutine_USED || __Pyx_Coroutine_Check(yf) #endif ) { ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit); #ifdef __Pyx_Coroutine_USED } else if (__Pyx_CoroutineAwait_CheckExact(yf)) { ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit); #endif } else { PyObject *meth = __Pyx_PyObject_GetAttrStr(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_Coroutine_Undelegate(gen); gen->is_running = 0; goto throw_here; } if (likely(args)) { ret = PyObject_CallObject(meth, args); } else { ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL); } Py_DECREF(meth); } gen->is_running = 0; Py_DECREF(yf); if (!ret) { ret = __Pyx_Coroutine_FinishDelegation(gen); } return __Pyx_Coroutine_MethodReturn(self, ret); } throw_here: __Pyx_Raise(typ, val, tb, NULL); return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0)); } static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) { PyObject *typ; PyObject *val = NULL; PyObject *tb = NULL; if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb)) return NULL; return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1); } static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) { Py_VISIT(exc_state->exc_type); Py_VISIT(exc_state->exc_value); Py_VISIT(exc_state->exc_traceback); return 0; } static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) { Py_VISIT(gen->closure); Py_VISIT(gen->classobj); Py_VISIT(gen->yieldfrom); return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg); } static int __Pyx_Coroutine_clear(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; Py_CLEAR(gen->closure); Py_CLEAR(gen->classobj); Py_CLEAR(gen->yieldfrom); __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer); } #endif Py_CLEAR(gen->gi_code); Py_CLEAR(gen->gi_name); Py_CLEAR(gen->gi_qualname); Py_CLEAR(gen->gi_modulename); return 0; } static void __Pyx_Coroutine_dealloc(PyObject *self) { __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) 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 && CYTHON_USE_TP_FINALIZE if (PyObject_CallFinalizerFromDealloc(self)) #else Py_TYPE(gen)->tp_del(self); if (self->ob_refcnt > 0) #endif { return; } PyObject_GC_UnTrack(self); } #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { /* We have to handle this case for asynchronous generators right here, because this code has to be between UNTRACK and GC_Del. */ Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer); } #endif __Pyx_Coroutine_clear(self); PyObject_GC_Del(gen); } static void __Pyx_Coroutine_del(PyObject *self) { PyObject *error_type, *error_value, *error_traceback; __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self; __Pyx_PyThreadState_declare if (gen->resume_label < 0) { return; } #if !CYTHON_USE_TP_FINALIZE assert(self->ob_refcnt == 0); self->ob_refcnt = 1; #endif __Pyx_PyThreadState_assign __Pyx_ErrFetch(&error_type, &error_value, &error_traceback); #ifdef __Pyx_AsyncGen_USED if (__Pyx_AsyncGen_CheckExact(self)) { __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self; PyObject *finalizer = agen->ag_finalizer; if (finalizer && !agen->ag_closed) { PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self); if (unlikely(!res)) { PyErr_WriteUnraisable(self); } else { Py_DECREF(res); } __Pyx_ErrRestore(error_type, error_value, error_traceback); return; } } #endif if (unlikely(gen->resume_label == 0 && !error_value)) { #ifdef __Pyx_Coroutine_USED #ifdef __Pyx_Generator_USED if (!__Pyx_Generator_CheckExact(self)) #endif { PyObject_GC_UnTrack(self); #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat) if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0)) PyErr_WriteUnraisable(self); #else {PyObject *msg; char *cmsg; #if CYTHON_COMPILING_IN_PYPY msg = NULL; cmsg = (char*) "coroutine was never awaited"; #else char *cname; PyObject *qualname; qualname = gen->gi_qualname; cname = PyString_AS_STRING(qualname); msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname); if (unlikely(!msg)) { PyErr_Clear(); cmsg = (char*) "coroutine was never awaited"; } else { cmsg = PyString_AS_STRING(msg); } #endif if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0)) PyErr_WriteUnraisable(self); Py_XDECREF(msg);} #endif PyObject_GC_Track(self); } #endif } else { PyObject *res = __Pyx_Coroutine_Close(self); if (unlikely(!res)) { if (PyErr_Occurred()) PyErr_WriteUnraisable(self); } else { Py_DECREF(res); } } __Pyx_ErrRestore(error_type, error_value, error_traceback); #if !CYTHON_USE_TP_FINALIZE assert(self->ob_refcnt > 0); if (--self->ob_refcnt == 0) { return; } { 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); _Py_DEC_REFTOTAL; #endif #ifdef COUNT_ALLOCS --Py_TYPE(self)->tp_frees; --Py_TYPE(self)->tp_allocs; #endif #endif } static PyObject * __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context) { PyObject *name = self->gi_name; if (unlikely(!name)) name = Py_None; Py_INCREF(name); return name; } static int __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context) { 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 = self->gi_name; Py_INCREF(value); self->gi_name = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context) { PyObject *name = self->gi_qualname; if (unlikely(!name)) name = Py_None; Py_INCREF(name); return name; } static int __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context) { 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 = self->gi_qualname; Py_INCREF(value); self->gi_qualname = value; Py_XDECREF(tmp); return 0; } static __pyx_CoroutineObject *__Pyx__Coroutine_New( PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name) { __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type); if (unlikely(!gen)) return NULL; return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name); } static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit( __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure, PyObject *name, PyObject *qualname, PyObject *module_name) { gen->body = body; gen->closure = closure; Py_XINCREF(closure); gen->is_running = 0; gen->resume_label = 0; gen->classobj = NULL; gen->yieldfrom = NULL; gen->gi_exc_state.exc_type = NULL; gen->gi_exc_state.exc_value = NULL; gen->gi_exc_state.exc_traceback = NULL; #if CYTHON_USE_EXC_INFO_STACK gen->gi_exc_state.previous_item = NULL; #endif gen->gi_weakreflist = NULL; Py_XINCREF(qualname); gen->gi_qualname = qualname; Py_XINCREF(name); gen->gi_name = name; Py_XINCREF(module_name); gen->gi_modulename = module_name; Py_XINCREF(code); gen->gi_code = code; PyObject_GC_Track(gen); return gen; } /* PatchGeneratorABC */ #ifndef CYTHON_REGISTER_ABCS #define CYTHON_REGISTER_ABCS 1 #endif #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) static PyObject* __Pyx_patch_abc_module(PyObject *module); static PyObject* __Pyx_patch_abc_module(PyObject *module) { module = __Pyx_Coroutine_patch_module( module, "" "if _cython_generator_type is not None:\n" " try: Generator = _module.Generator\n" " except AttributeError: pass\n" " else: Generator.register(_cython_generator_type)\n" "if _cython_coroutine_type is not None:\n" " try: Coroutine = _module.Coroutine\n" " except AttributeError: pass\n" " else: Coroutine.register(_cython_coroutine_type)\n" ); return module; } #endif static int __Pyx_patch_abc(void) { #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) static int abc_patched = 0; if (CYTHON_REGISTER_ABCS && !abc_patched) { PyObject *module; module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections"); if (!module) { PyErr_WriteUnraisable(NULL); if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, ((PY_MAJOR_VERSION >= 3) ? "Cython module failed to register with collections.abc module" : "Cython module failed to register with collections module"), 1) < 0)) { return -1; } } else { module = __Pyx_patch_abc_module(module); abc_patched = 1; if (unlikely(!module)) return -1; Py_DECREF(module); } module = PyImport_ImportModule("backports_abc"); if (module) { module = __Pyx_patch_abc_module(module); Py_XDECREF(module); } if (!module) { PyErr_Clear(); } } #else if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL); #endif return 0; } /* Generator */ static PyMethodDef __pyx_Generator_methods[] = { {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O, (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")}, {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS, (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")}, {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS, (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")}, {0, 0, 0, 0} }; static PyMemberDef __pyx_Generator_memberlist[] = { {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL}, {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY, (char*) PyDoc_STR("object being iterated by 'yield from', or None")}, {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL}, {0, 0, 0, 0, 0} }; static PyGetSetDef __pyx_Generator_getsets[] = { {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name, (char*) PyDoc_STR("name of the generator"), 0}, {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname, (char*) PyDoc_STR("qualified name of the generator"), 0}, {0, 0, 0, 0, 0} }; static PyTypeObject __pyx_GeneratorType_type = { PyVarObject_HEAD_INIT(0, 0) "generator", sizeof(__pyx_CoroutineObject), 0, (destructor) __Pyx_Coroutine_dealloc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, 0, (traverseproc) __Pyx_Coroutine_traverse, 0, 0, offsetof(__pyx_CoroutineObject, gi_weakreflist), 0, (iternextfunc) __Pyx_Generator_Next, __pyx_Generator_methods, __pyx_Generator_memberlist, __pyx_Generator_getsets, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if CYTHON_USE_TP_FINALIZE 0, #else __Pyx_Coroutine_del, #endif 0, #if CYTHON_USE_TP_FINALIZE __Pyx_Coroutine_del, #elif PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 0, #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, #endif }; static int __pyx_Generator_init(void) { __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter; __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type); if (unlikely(!__pyx_GeneratorType)) { return -1; } return 0; } /* CheckBinaryVersion */ 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); return PyErr_WarnEx(NULL, message, 1); } return 0; } /* FunctionExport */ 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 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; } /* InitStrings */ 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 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; if (PyObject_Hash(*t->p) == -1) 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 const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { 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 *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const 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)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #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 int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type %.200s). " "The ability to return an instance of a strict subclass of int " "is deprecated, and may be removed in a future version of Python.", Py_TYPE(result)->tp_name)) { Py_DECREF(result); return NULL; } return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", type_name, type_name, Py_TYPE(result)->tp_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } 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))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ cytoolz-0.10.1/cytoolz/functoolz.pxd000066400000000000000000000023441355770264200175550ustar00rootroot00000000000000cpdef object identity(object x) cdef object c_thread_first(object val, object forms) cdef object c_thread_last(object val, object forms) cdef class curry: cdef readonly object _sigspec cdef readonly object _has_unknown_args cdef readonly object func cdef readonly tuple args cdef readonly dict keywords cdef public object __doc__ cdef public object __name__ cdef public object __module__ cdef public object __qualname__ cpdef object memoize(object func, object cache=*, object key=*) cdef class _memoize: cdef object func cdef object cache cdef object key cdef bint is_unary cdef bint may_have_kwargs cdef class Compose: cdef public object first cdef public tuple funcs cdef object c_compose(object funcs) cdef object c_compose_left(object funcs) cdef object c_pipe(object data, object funcs) cdef class complement: cdef object func cdef class _juxt_inner: cdef public tuple funcs cdef object c_juxt(object funcs) cpdef object do(object func, object x) cpdef object flip(object func, object a, object b) cpdef object return_none(object exc) cdef class excepts: cdef public object exc cdef public object func cdef public object handler cytoolz-0.10.1/cytoolz/functoolz.pyx000066400000000000000000000611161355770264200176040ustar00rootroot00000000000000import inspect import sys from functools import partial from operator import attrgetter from textwrap import dedent from types import MethodType from cytoolz.utils import no_default from cytoolz.compatibility import PY3, PY34, filter as ifilter, map as imap, reduce, import_module import cytoolz._signatures as _sigs from toolz.functoolz import (InstanceProperty, instanceproperty, is_arity, num_required_args, has_varargs, has_keywords, is_valid_args, is_partial_args) cimport cython from cpython.dict cimport PyDict_Merge, PyDict_New from cpython.object cimport (PyCallable_Check, PyObject_Call, PyObject_CallObject, PyObject_RichCompare, Py_EQ, Py_NE) from cpython.ref cimport PyObject from cpython.sequence cimport PySequence_Concat from cpython.set cimport PyFrozenSet_New from cpython.tuple cimport PyTuple_Check, PyTuple_GET_SIZE __all__ = ['identity', 'thread_first', 'thread_last', 'memoize', 'compose', 'compose_left', 'pipe', 'complement', 'juxt', 'do', 'curry', 'memoize', 'flip', 'excepts', 'apply'] cpdef object identity(object x): return x def apply(*func_and_args, **kwargs): """ Applies a function and returns the results >>> def double(x): return 2*x >>> def inc(x): return x + 1 >>> apply(double, 5) 10 >>> tuple(map(apply, [double, inc, double], [10, 500, 8000])) (20, 501, 16000) """ if not func_and_args: raise TypeError('func argument is required') return func_and_args[0](*func_and_args[1:], **kwargs) cdef object c_thread_first(object val, object forms): cdef object form, func cdef tuple args for form in forms: if PyCallable_Check(form): val = form(val) elif PyTuple_Check(form): func, args = form[0], (val,) + form[1:] val = PyObject_CallObject(func, args) else: val = None return val def thread_first(val, *forms): """ Thread value through a sequence of functions/forms >>> def double(x): return 2*x >>> def inc(x): return x + 1 >>> thread_first(1, inc, double) 4 If the function expects more than one input you can specify those inputs in a tuple. The value is used as the first input. >>> def add(x, y): return x + y >>> def pow(x, y): return x**y >>> thread_first(1, (add, 4), (pow, 2)) # pow(add(1, 4), 2) 25 So in general thread_first(x, f, (g, y, z)) expands to g(f(x), y, z) See Also: thread_last """ return c_thread_first(val, forms) cdef object c_thread_last(object val, object forms): cdef object form, func cdef tuple args for form in forms: if PyCallable_Check(form): val = form(val) elif PyTuple_Check(form): func, args = form[0], form[1:] + (val,) val = PyObject_CallObject(func, args) else: val = None return val def thread_last(val, *forms): """ Thread value through a sequence of functions/forms >>> def double(x): return 2*x >>> def inc(x): return x + 1 >>> thread_last(1, inc, double) 4 If the function expects more than one input you can specify those inputs in a tuple. The value is used as the last input. >>> def add(x, y): return x + y >>> def pow(x, y): return x**y >>> thread_last(1, (add, 4), (pow, 2)) # pow(2, add(4, 1)) 32 So in general thread_last(x, f, (g, y, z)) expands to g(y, z, f(x)) >>> def iseven(x): ... return x % 2 == 0 >>> list(thread_last([1, 2, 3], (map, inc), (filter, iseven))) [2, 4] See Also: thread_first """ return c_thread_last(val, forms) cdef struct partialobject: PyObject _ PyObject *fn PyObject *args PyObject *kw PyObject *dict PyObject *weakreflist cdef object _partial = partial(lambda: None) cdef object _empty_kwargs(): if ( _partial).kw is None: return None return PyDict_New() cdef class curry: """ curry(self, *args, **kwargs) Curry a callable function Enables partial application of arguments through calling a function with an incomplete set of arguments. >>> def mul(x, y): ... return x * y >>> mul = curry(mul) >>> double = mul(2) >>> double(10) 20 Also supports keyword arguments >>> @curry # Can use curry as a decorator ... def f(x, y, a=10): ... return a * (x + y) >>> add = f(a=1) >>> add(2, 3) 5 See Also: cytoolz.curried - namespace of curried functions https://toolz.readthedocs.io/en/latest/curry.html """ def __cinit__(self, *args, **kwargs): if not args: raise TypeError('__init__() takes at least 2 arguments (1 given)') func, args = args[0], args[1:] if not PyCallable_Check(func): raise TypeError("Input must be callable") # curry- or functools.partial-like object? Unpack and merge arguments if (hasattr(func, 'func') and hasattr(func, 'args') and hasattr(func, 'keywords') and isinstance(func.args, tuple)): if func.keywords: PyDict_Merge(kwargs, func.keywords, False) ## Equivalent to: # for key, val in func.keywords.items(): # if key not in kwargs: # kwargs[key] = val args = func.args + args func = func.func self.func = func self.args = args self.keywords = kwargs if kwargs else _empty_kwargs() self.__doc__ = getattr(func, '__doc__', None) self.__name__ = getattr(func, '__name__', '') self.__module__ = getattr(func, '__module__', None) self.__qualname__ = getattr(func, '__qualname__', None) self._sigspec = None self._has_unknown_args = None def __str__(self): return str(self.func) def __repr__(self): return repr(self.func) def __hash__(self): return hash((self.func, self.args, frozenset(self.keywords.items()) if self.keywords else None)) def __richcmp__(self, other, int op): is_equal = (isinstance(other, curry) and self.func == other.func and self.args == other.args and self.keywords == other.keywords) if op == Py_EQ: return is_equal if op == Py_NE: return not is_equal return PyObject_RichCompare(id(self), id(other), op) def __call__(self, *args, **kwargs): cdef object val if PyTuple_GET_SIZE(args) == 0: args = self.args elif PyTuple_GET_SIZE(self.args) != 0: args = PySequence_Concat(self.args, args) if self.keywords is not None: PyDict_Merge(kwargs, self.keywords, False) try: return self.func(*args, **kwargs) except TypeError as val: if self._should_curry_internal(args, kwargs, val): return type(self)(self.func, *args, **kwargs) raise def _should_curry(self, args, kwargs, exc=None): if PyTuple_GET_SIZE(args) == 0: args = self.args elif PyTuple_GET_SIZE(self.args) != 0: args = PySequence_Concat(self.args, args) if self.keywords is not None: PyDict_Merge(kwargs, self.keywords, False) return self._should_curry_internal(args, kwargs) def _should_curry_internal(self, args, kwargs, exc=None): func = self.func # `toolz` has these three lines #args = self.args + args #if self.keywords: # kwargs = dict(self.keywords, **kwargs) if self._sigspec is None: sigspec = self._sigspec = _sigs.signature_or_spec(func) self._has_unknown_args = has_varargs(func, sigspec) is not False else: sigspec = self._sigspec if is_partial_args(func, args, kwargs, sigspec) is False: # Nothing can make the call valid return False elif self._has_unknown_args: # The call may be valid and raised a TypeError, but we curry # anyway because the function may have `*args`. This is useful # for decorators with signature `func(*args, **kwargs)`. return True elif not is_valid_args(func, args, kwargs, sigspec): # Adding more arguments may make the call valid return True else: # There was a genuine TypeError return False def bind(self, *args, **kwargs): return type(self)(self, *args, **kwargs) def call(self, *args, **kwargs): cdef object val if PyTuple_GET_SIZE(args) == 0: args = self.args elif PyTuple_GET_SIZE(self.args) != 0: args = PySequence_Concat(self.args, args) if self.keywords is not None: PyDict_Merge(kwargs, self.keywords, False) return self.func(*args, **kwargs) def __get__(self, instance, owner): if instance is None: return self return type(self)(self, instance) property __signature__: def __get__(self): sig = inspect.signature(self.func) args = self.args or () keywords = self.keywords or {} if is_partial_args(self.func, args, keywords, sig) is False: raise TypeError('curry object has incorrect arguments') params = list(sig.parameters.values()) skip = 0 for param in params[:len(args)]: if param.kind == param.VAR_POSITIONAL: break skip += 1 kwonly = False newparams = [] for param in params[skip:]: kind = param.kind default = param.default if kind == param.VAR_KEYWORD: pass elif kind == param.VAR_POSITIONAL: if kwonly: continue elif param.name in keywords: default = keywords[param.name] kind = param.KEYWORD_ONLY kwonly = True else: if kwonly: kind = param.KEYWORD_ONLY if default is param.empty: default = no_default newparams.append(param.replace(default=default, kind=kind)) return sig.replace(parameters=newparams) def __reduce__(self): func = self.func modname = getattr(func, '__module__', None) qualname = getattr(func, '__qualname__', None) if qualname is None: qualname = getattr(func, '__name__', None) is_decorated = None if modname and qualname: attrs = [] obj = import_module(modname) for attr in qualname.split('.'): if isinstance(obj, curry): attrs.append('func') obj = obj.func obj = getattr(obj, attr, None) if obj is None: break attrs.append(attr) if isinstance(obj, curry) and obj.func is func: is_decorated = obj is self qualname = '.'.join(attrs) func = '%s:%s' % (modname, qualname) state = (type(self), func, self.args, self.keywords, is_decorated) return (_restore_curry, state) cpdef object _restore_curry(cls, func, args, kwargs, is_decorated): if isinstance(func, str): modname, qualname = func.rsplit(':', 1) obj = import_module(modname) for attr in qualname.split('.'): obj = getattr(obj, attr) if is_decorated: return obj func = obj.func obj = cls(func, *args, **(kwargs or {})) return obj cpdef object memoize(object func, object cache=None, object key=None): """ Cache a function's result for speedy future evaluation Considerations: Trades memory for speed. Only use on pure functions. >>> def add(x, y): return x + y >>> add = memoize(add) Or use as a decorator >>> @memoize ... def add(x, y): ... return x + y Use the ``cache`` keyword to provide a dict-like object as an initial cache >>> @memoize(cache={(1, 2): 3}) ... def add(x, y): ... return x + y Note that the above works as a decorator because ``memoize`` is curried. It is also possible to provide a ``key(args, kwargs)`` function that calculates keys used for the cache, which receives an ``args`` tuple and ``kwargs`` dict as input, and must return a hashable value. However, the default key function should be sufficient most of the time. >>> # Use key function that ignores extraneous keyword arguments >>> @memoize(key=lambda args, kwargs: args) ... def add(x, y, verbose=False): ... if verbose: ... print('Calculating %s + %s' % (x, y)) ... return x + y """ return _memoize(func, cache, key) cdef class _memoize: property __doc__: def __get__(self): return self.func.__doc__ property __name__: def __get__(self): return self.func.__name__ property __wrapped__: def __get__(self): return self.func def __cinit__(self, func, cache, key): self.func = func if cache is None: self.cache = PyDict_New() else: self.cache = cache self.key = key try: self.may_have_kwargs = has_keywords(func) is not False # Is unary function (single arg, no variadic argument or keywords)? self.is_unary = is_arity(1, func) except TypeError: self.is_unary = False self.may_have_kwargs = True def __call__(self, *args, **kwargs): cdef object key if self.key is not None: key = self.key(args, kwargs) elif self.is_unary: key = args[0] elif self.may_have_kwargs: key = (args or None, PyFrozenSet_New(kwargs.items()) if kwargs else None) else: key = args if key in self.cache: return self.cache[key] else: result = PyObject_Call(self.func, args, kwargs) self.cache[key] = result return result def __get__(self, instance, owner): if instance is None: return self return curry(self, instance) cdef class Compose: """ Compose(self, *funcs) A composition of functions See Also: compose """ # fix for #103, note: we cannot use __name__ at module-scope in cython __module__ = 'cytooz.functoolz' def __cinit__(self, *funcs): self.first = funcs[-1] self.funcs = tuple(reversed(funcs[:-1])) def __call__(self, *args, **kwargs): cdef object func, ret ret = PyObject_Call(self.first, args, kwargs) for func in self.funcs: ret = func(ret) return ret def __reduce__(self): return (Compose, (self.first,), self.funcs) def __setstate__(self, state): self.funcs = state def __repr__(self): return '{.__class__.__name__}{!r}'.format( self, tuple(reversed((self.first, ) + self.funcs))) def __eq__(self, other): if isinstance(other, Compose): return other.first == self.first and other.funcs == self.funcs return NotImplemented def __ne__(self, other): if isinstance(other, Compose): return other.first != self.first or other.funcs != self.funcs return NotImplemented def __hash__(self): return hash(self.first) ^ hash(self.funcs) def __get__(self, obj, objtype): if obj is None: return self elif PY3: return MethodType(self, obj) else: return MethodType(self, obj, objtype) property __wrapped__: def __get__(self): return self.first property __signature__: def __get__(self): base = inspect.signature(self.first) last = inspect.signature(self.funcs[-1]) return base.replace(return_annotation=last.return_annotation) property __name__: def __get__(self): try: return '_of_'.join( f.__name__ for f in reversed((self.first,) + self.funcs) ) except AttributeError: return type(self).__name__ property __doc__: def __get__(self): def composed_doc(*fs): """Generate a docstring for the composition of fs. """ if not fs: # Argument name for the docstring. return '*args, **kwargs' return '{f}({g})'.format(f=fs[0].__name__, g=composed_doc(*fs[1:])) try: return ( 'lambda *args, **kwargs: ' + composed_doc(*reversed((self.first,) + self.funcs)) ) except AttributeError: # One of our callables does not have a `__name__`, whatever. return 'A composition of functions' cdef object c_compose(object funcs): if not funcs: return identity elif len(funcs) == 1: return funcs[0] else: return Compose(*funcs) def compose(*funcs): """ Compose functions to operate in series. Returns a function that applies other functions in sequence. Functions are applied from right to left so that ``compose(f, g, h)(x, y)`` is the same as ``f(g(h(x, y)))``. If no arguments are provided, the identity function (f(x) = x) is returned. >>> inc = lambda i: i + 1 >>> compose(str, inc)(3) '4' See Also: compose_left pipe """ return c_compose(funcs) cdef object c_compose_left(object funcs): if not funcs: return identity elif len(funcs) == 1: return funcs[0] else: return Compose(*reversed(funcs)) def compose_left(*funcs): """ Compose functions to operate in series. Returns a function that applies other functions in sequence. Functions are applied from left to right so that ``compose_left(f, g, h)(x, y)`` is the same as ``h(g(f(x, y)))``. If no arguments are provided, the identity function (f(x) = x) is returned. >>> inc = lambda i: i + 1 >>> compose_left(inc, str)(3) '4' See Also: compose pipe """ return c_compose_left(funcs) cdef object c_pipe(object data, object funcs): cdef object func for func in funcs: data = func(data) return data def pipe(data, *funcs): """ Pipe a value through a sequence of functions I.e. ``pipe(data, f, g, h)`` is equivalent to ``h(g(f(data)))`` We think of the value as progressing through a pipe of several transformations, much like pipes in UNIX ``$ cat data | f | g | h`` >>> double = lambda i: 2 * i >>> pipe(3, double, str) '6' See Also: compose compose_left thread_first thread_last """ return c_pipe(data, funcs) cdef class complement: """ complement(func) Convert a predicate function to its logical complement. In other words, return a function that, for inputs that normally yield True, yields False, and vice-versa. >>> def iseven(n): return n % 2 == 0 >>> isodd = complement(iseven) >>> iseven(2) True >>> isodd(2) False """ def __cinit__(self, func): self.func = func def __call__(self, *args, **kwargs): return not PyObject_Call(self.func, args, kwargs) # use PyObject_Not? def __reduce__(self): return (complement, (self.func,)) cdef class _juxt_inner: def __cinit__(self, funcs): self.funcs = tuple(funcs) def __call__(self, *args, **kwargs): if kwargs: return tuple(PyObject_Call(func, args, kwargs) for func in self.funcs) else: return tuple(PyObject_CallObject(func, args) for func in self.funcs) def __reduce__(self): return (_juxt_inner, (self.funcs,)) cdef object c_juxt(object funcs): return _juxt_inner(funcs) def juxt(*funcs): """ Creates a function that calls several functions with the same arguments Takes several functions and returns a function that applies its arguments to each of those functions then returns a tuple of the results. Name comes from juxtaposition: the fact of two things being seen or placed close together with contrasting effect. >>> inc = lambda x: x + 1 >>> double = lambda x: x * 2 >>> juxt(inc, double)(10) (11, 20) >>> juxt([inc, double])(10) (11, 20) """ if len(funcs) == 1 and not PyCallable_Check(funcs[0]): funcs = funcs[0] return c_juxt(funcs) cpdef object do(object func, object x): """ Runs ``func`` on ``x``, returns ``x`` Because the results of ``func`` are not returned, only the side effects of ``func`` are relevant. Logging functions can be made by composing ``do`` with a storage function like ``list.append`` or ``file.write`` >>> from cytoolz import compose >>> from cytoolz.curried import do >>> log = [] >>> inc = lambda x: x + 1 >>> inc = compose(inc, do(log.append)) >>> inc(1) 2 >>> inc(11) 12 >>> log [1, 11] """ func(x) return x cpdef object flip(object func, object a, object b): """ Call the function call with the arguments flipped This function is curried. >>> def div(a, b): ... return a // b ... >>> flip(div, 2, 6) 3 >>> div_by_two = flip(div, 2) >>> div_by_two(4) 2 This is particularly useful for built in functions and functions defined in C extensions that accept positional only arguments. For example: isinstance, issubclass. >>> data = [1, 'a', 'b', 2, 1.5, object(), 3] >>> only_ints = list(filter(flip(isinstance, int), data)) >>> only_ints [1, 2, 3] """ return PyObject_CallObject(func, (b, a)) _flip = flip # uncurried cpdef object return_none(object exc): """ Returns None. """ return None cdef class excepts: """ A wrapper around a function to catch exceptions and dispatch to a handler. This is like a functional try/except block, in the same way that ifexprs are functional if/else blocks. Examples -------- >>> excepting = excepts( ... ValueError, ... lambda a: [1, 2].index(a), ... lambda _: -1, ... ) >>> excepting(1) 0 >>> excepting(3) -1 Multiple exceptions and default except clause. >>> excepting = excepts((IndexError, KeyError), lambda a: a[0]) >>> excepting([]) >>> excepting([1]) 1 >>> excepting({}) >>> excepting({0: 1}) 1 """ def __init__(self, exc, func, handler=return_none): self.exc = exc self.func = func self.handler = handler def __call__(self, *args, **kwargs): try: return self.func(*args, **kwargs) except self.exc as e: return self.handler(e) property __name__: def __get__(self): exc = self.exc try: if isinstance(exc, tuple): exc_name = '_or_'.join(map(attrgetter('__name__'), exc)) else: exc_name = exc.__name__ return '%s_excepting_%s' % (self.func.__name__, exc_name) except AttributeError: return 'excepting' property __doc__: def __get__(self): exc = self.exc try: if isinstance(exc, tuple): exc_name = '(%s)' % ', '.join( map(attrgetter('__name__'), exc), ) else: exc_name = exc.__name__ return dedent( """\ A wrapper around {inst.func.__name__!r} that will except: {exc} and handle any exceptions with {inst.handler.__name__!r}. Docs for {inst.func.__name__!r}: {inst.func.__doc__} Docs for {inst.handler.__name__!r}: {inst.handler.__doc__} """ ).format( inst=self, exc=exc_name, ) except AttributeError: return type(self).__doc__ cytoolz-0.10.1/cytoolz/itertoolz.c000066400000000000000000070011551355770264200172220ustar00rootroot00000000000000/* Generated by Cython 0.29.14 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [], "name": "cytoolz.itertoolz", "sources": [ "cytoolz/itertoolz.pyx" ] }, "module_name": "cytoolz.itertoolz" } END: Cython Metadata */ #define PY_SSIZE_T_CLEAN #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 < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else #define CYTHON_ABI "0_29_14" #define CYTHON_HEX_VERSION 0x001D0EF0 #define CYTHON_FUTURE_DIVISION 0 #include #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 #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x02070000 #define HAVE_LONG_LONG #endif #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_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) #endif #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } # else # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int32 uint32_t; #endif #endif #else #include #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) && __cplusplus >= 201103L #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #elif __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__ ) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #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" #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #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) #endif #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_FAST_PYCCALL #define __Pyx_PyFastCFunction_Check(func)\ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 #define PyMem_RawMalloc(n) PyMem_Malloc(n) #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) #define PyMem_RawFree(p) PyMem_Free(p) #endif #if CYTHON_COMPILING_IN_PYSTON #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #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 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) #else #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) #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_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #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) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #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_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) #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])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if 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 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #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 #define PyObject_Unicode PyObject_Str #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_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #else #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #endif #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_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #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 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { \ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ } #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__cytoolz__itertoolz #define __PYX_HAVE_API__cytoolz__itertoolz /* Early includes */ #include #include #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const 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_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) 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); } #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_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_ASSUME_SAFE_MACROS #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 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(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*) "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) + 1); 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 CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_cython_runtime = NULL; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; 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[] = { "cytoolz/itertoolz.pyx", "stringsource", "type.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_7cytoolz_9itertoolz_remove; struct __pyx_obj_7cytoolz_9itertoolz_accumulate; struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted; struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key; struct __pyx_obj_7cytoolz_9itertoolz_interleave; struct __pyx_obj_7cytoolz_9itertoolz__unique_key; struct __pyx_obj_7cytoolz_9itertoolz__unique_identity; struct __pyx_obj_7cytoolz_9itertoolz_interpose; struct __pyx_obj_7cytoolz_9itertoolz_iterate; struct __pyx_obj_7cytoolz_9itertoolz_sliding_window; struct __pyx_obj_7cytoolz_9itertoolz_partition_all; struct __pyx_obj_7cytoolz_9itertoolz__pluck_index; struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default; struct __pyx_obj_7cytoolz_9itertoolz__pluck_list; struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default; struct __pyx_obj_7cytoolz_9itertoolz__getter_index; struct __pyx_obj_7cytoolz_9itertoolz__getter_list; struct __pyx_obj_7cytoolz_9itertoolz__getter_null; struct __pyx_obj_7cytoolz_9itertoolz__join; struct __pyx_obj_7cytoolz_9itertoolz__inner_join; struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join; struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join; struct __pyx_obj_7cytoolz_9itertoolz__outer_join; struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key; struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index; struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices; struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key; struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index; struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices; struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key; struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index; struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices; struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key; struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index; struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices; struct __pyx_obj_7cytoolz_9itertoolz__diff_key; struct __pyx_obj_7cytoolz_9itertoolz__diff_identity; struct __pyx_obj_7cytoolz_9itertoolz_random_sample; struct __pyx_opt_args_7cytoolz_9itertoolz_c_merge_sorted; struct __pyx_opt_args_7cytoolz_9itertoolz_unique; struct __pyx_opt_args_7cytoolz_9itertoolz_get; struct __pyx_opt_args_7cytoolz_9itertoolz_reduceby; struct __pyx_opt_args_7cytoolz_9itertoolz_partition; struct __pyx_opt_args_7cytoolz_9itertoolz_pluck; struct __pyx_opt_args_7cytoolz_9itertoolz_join; struct __pyx_opt_args_7cytoolz_9itertoolz_c_diff; struct __pyx_opt_args_7cytoolz_9itertoolz_topk; /* "cytoolz/itertoolz.pxd":34 * * * cdef object c_merge_sorted(object seqs, object key=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9itertoolz_c_merge_sorted { int __pyx_n; PyObject *key; }; /* "cytoolz/itertoolz.pxd":55 * * * cpdef object unique(object seq, object key=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9itertoolz_unique { int __pyx_n; PyObject *key; }; /* "cytoolz/itertoolz.pxd":91 * * * cpdef object get(object ind, object seq, object default=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9itertoolz_get { int __pyx_n; PyObject *__pyx_default; }; /* "cytoolz/itertoolz.pxd":113 * * * cpdef dict reduceby(object key, object binop, object seq, object init=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9itertoolz_reduceby { int __pyx_n; PyObject *init; }; /* "cytoolz/itertoolz.pxd":128 * * * cpdef object partition(Py_ssize_t n, object seq, object pad=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9itertoolz_partition { int __pyx_n; PyObject *pad; }; /* "cytoolz/itertoolz.pxd":163 * * * cpdef object pluck(object ind, object seqs, object default=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9itertoolz_pluck { int __pyx_n; PyObject *__pyx_default; }; /* "cytoolz/itertoolz.pxd":182 * * * cpdef object join(object leftkey, object leftseq, # <<<<<<<<<<<<<< * object rightkey, object rightseq, * object left_default=*, */ struct __pyx_opt_args_7cytoolz_9itertoolz_join { int __pyx_n; PyObject *left_default; PyObject *right_default; }; /* "cytoolz/itertoolz.pxd":266 * * * cdef object c_diff(object seqs, object default=*, object key=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9itertoolz_c_diff { int __pyx_n; PyObject *__pyx_default; PyObject *key; }; /* "cytoolz/itertoolz.pxd":269 * * * cpdef object topk(Py_ssize_t k, object seq, object key=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9itertoolz_topk { int __pyx_n; PyObject *key; }; /* "cytoolz/itertoolz.pxd":1 * cdef class remove: # <<<<<<<<<<<<<< * cdef object predicate * cdef object iter_seq */ struct __pyx_obj_7cytoolz_9itertoolz_remove { PyObject_HEAD PyObject *predicate; PyObject *iter_seq; }; /* "cytoolz/itertoolz.pxd":6 * * * cdef class accumulate: # <<<<<<<<<<<<<< * cdef object binop * cdef object iter_seq */ struct __pyx_obj_7cytoolz_9itertoolz_accumulate { PyObject_HEAD PyObject *binop; PyObject *iter_seq; PyObject *result; PyObject *initial; }; /* "cytoolz/itertoolz.pxd":16 * * * cdef class _merge_sorted: # <<<<<<<<<<<<<< * cdef object seq1 * cdef object seq2 */ struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted { PyObject_HEAD PyObject *seq1; PyObject *seq2; PyObject *val1; PyObject *val2; Py_ssize_t loop; }; /* "cytoolz/itertoolz.pxd":23 * cdef Py_ssize_t loop * * cdef class _merge_sorted_key: # <<<<<<<<<<<<<< * cdef object seq1 * cdef object seq2 */ struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key { PyObject_HEAD PyObject *seq1; PyObject *seq2; PyObject *val1; PyObject *val2; PyObject *key; PyObject *key1; PyObject *key2; Py_ssize_t loop; }; /* "cytoolz/itertoolz.pxd":37 * * * cdef class interleave: # <<<<<<<<<<<<<< * cdef list iters * cdef list newiters */ struct __pyx_obj_7cytoolz_9itertoolz_interleave { PyObject_HEAD PyObject *iters; PyObject *newiters; Py_ssize_t i; Py_ssize_t n; }; /* "cytoolz/itertoolz.pxd":44 * * * cdef class _unique_key: # <<<<<<<<<<<<<< * cdef object key * cdef object iter_seq */ struct __pyx_obj_7cytoolz_9itertoolz__unique_key { PyObject_HEAD PyObject *key; PyObject *iter_seq; PyObject *seen; }; /* "cytoolz/itertoolz.pxd":50 * * * cdef class _unique_identity: # <<<<<<<<<<<<<< * cdef object iter_seq * cdef object seen */ struct __pyx_obj_7cytoolz_9itertoolz__unique_identity { PyObject_HEAD PyObject *iter_seq; PyObject *seen; }; /* "cytoolz/itertoolz.pxd":103 * * * cdef class interpose: # <<<<<<<<<<<<<< * cdef object el * cdef object iter_seq */ struct __pyx_obj_7cytoolz_9itertoolz_interpose { PyObject_HEAD PyObject *el; PyObject *iter_seq; PyObject *val; int do_el; }; /* "cytoolz/itertoolz.pxd":116 * * * cdef class iterate: # <<<<<<<<<<<<<< * cdef object func * cdef object x */ struct __pyx_obj_7cytoolz_9itertoolz_iterate { PyObject_HEAD PyObject *func; PyObject *x; PyObject *val; }; /* "cytoolz/itertoolz.pxd":122 * * * cdef class sliding_window: # <<<<<<<<<<<<<< * cdef object iterseq * cdef tuple prev */ struct __pyx_obj_7cytoolz_9itertoolz_sliding_window { PyObject_HEAD PyObject *iterseq; PyObject *prev; Py_ssize_t n; }; /* "cytoolz/itertoolz.pxd":131 * * * cdef class partition_all: # <<<<<<<<<<<<<< * cdef Py_ssize_t n * cdef object iterseq */ struct __pyx_obj_7cytoolz_9itertoolz_partition_all { PyObject_HEAD Py_ssize_t n; PyObject *iterseq; }; /* "cytoolz/itertoolz.pxd":139 * * * cdef class _pluck_index: # <<<<<<<<<<<<<< * cdef object ind * cdef object iterseqs */ struct __pyx_obj_7cytoolz_9itertoolz__pluck_index { PyObject_HEAD PyObject *ind; PyObject *iterseqs; }; /* "cytoolz/itertoolz.pxd":144 * * * cdef class _pluck_index_default: # <<<<<<<<<<<<<< * cdef object ind * cdef object iterseqs */ struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default { PyObject_HEAD PyObject *ind; PyObject *iterseqs; PyObject *__pyx_default; }; /* "cytoolz/itertoolz.pxd":150 * * * cdef class _pluck_list: # <<<<<<<<<<<<<< * cdef list ind * cdef object iterseqs */ struct __pyx_obj_7cytoolz_9itertoolz__pluck_list { PyObject_HEAD PyObject *ind; PyObject *iterseqs; Py_ssize_t n; }; /* "cytoolz/itertoolz.pxd":156 * * * cdef class _pluck_list_default: # <<<<<<<<<<<<<< * cdef list ind * cdef object iterseqs */ struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default { PyObject_HEAD PyObject *ind; PyObject *iterseqs; PyObject *__pyx_default; Py_ssize_t n; }; /* "cytoolz/itertoolz.pxd":166 * * * cdef class _getter_index: # <<<<<<<<<<<<<< * cdef object ind * */ struct __pyx_obj_7cytoolz_9itertoolz__getter_index { PyObject_HEAD PyObject *ind; }; /* "cytoolz/itertoolz.pxd":170 * * * cdef class _getter_list: # <<<<<<<<<<<<<< * cdef list ind * cdef Py_ssize_t n */ struct __pyx_obj_7cytoolz_9itertoolz__getter_list { PyObject_HEAD PyObject *ind; Py_ssize_t n; }; /* "cytoolz/itertoolz.pxd":175 * * * cdef class _getter_null: # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__getter_null { PyObject_HEAD }; /* "cytoolz/itertoolz.pxd":187 * object right_default=*) * * cdef class _join: # <<<<<<<<<<<<<< * cdef dict d * cdef list matches */ struct __pyx_obj_7cytoolz_9itertoolz__join { PyObject_HEAD struct __pyx_vtabstruct_7cytoolz_9itertoolz__join *__pyx_vtab; PyObject *d; PyObject *matches; PyObject *seen_keys; PyObject *leftseq; PyObject *rightseq; PyObject *_rightkey; PyObject *right; PyObject *left_default; PyObject *right_default; PyObject *keys; Py_ssize_t N; Py_ssize_t i; int is_rightseq_exhausted; }; /* "cytoolz/itertoolz.pxd":205 * * * cdef class _inner_join(_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__inner_join { struct __pyx_obj_7cytoolz_9itertoolz__join __pyx_base; }; /* "cytoolz/itertoolz.pxd":208 * pass * * cdef class _right_outer_join(_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join { struct __pyx_obj_7cytoolz_9itertoolz__join __pyx_base; }; /* "cytoolz/itertoolz.pxd":211 * pass * * cdef class _left_outer_join(_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join { struct __pyx_obj_7cytoolz_9itertoolz__join __pyx_base; }; /* "cytoolz/itertoolz.pxd":214 * pass * * cdef class _outer_join(_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__outer_join { struct __pyx_obj_7cytoolz_9itertoolz__join __pyx_base; }; /* "cytoolz/itertoolz.pxd":218 * * * cdef class _inner_join_key(_inner_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key { struct __pyx_obj_7cytoolz_9itertoolz__inner_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":221 * pass * * cdef class _inner_join_index(_inner_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index { struct __pyx_obj_7cytoolz_9itertoolz__inner_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":224 * pass * * cdef class _inner_join_indices(_inner_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices { struct __pyx_obj_7cytoolz_9itertoolz__inner_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":227 * pass * * cdef class _right_outer_join_key(_right_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key { struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":230 * pass * * cdef class _right_outer_join_index(_right_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index { struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":233 * pass * * cdef class _right_outer_join_indices(_right_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices { struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":236 * pass * * cdef class _left_outer_join_key(_left_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key { struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":239 * pass * * cdef class _left_outer_join_index(_left_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index { struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":242 * pass * * cdef class _left_outer_join_indices(_left_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices { struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":245 * pass * * cdef class _outer_join_key(_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key { struct __pyx_obj_7cytoolz_9itertoolz__outer_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":248 * pass * * cdef class _outer_join_index(_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index { struct __pyx_obj_7cytoolz_9itertoolz__outer_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":251 * pass * * cdef class _outer_join_indices(_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices { struct __pyx_obj_7cytoolz_9itertoolz__outer_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":255 * * * cdef class _diff_key: # <<<<<<<<<<<<<< * cdef Py_ssize_t N * cdef object iters */ struct __pyx_obj_7cytoolz_9itertoolz__diff_key { PyObject_HEAD Py_ssize_t N; PyObject *iters; PyObject *key; }; /* "cytoolz/itertoolz.pxd":261 * * * cdef class _diff_identity: # <<<<<<<<<<<<<< * cdef Py_ssize_t N * cdef object iters */ struct __pyx_obj_7cytoolz_9itertoolz__diff_identity { PyObject_HEAD Py_ssize_t N; PyObject *iters; }; /* "cytoolz/itertoolz.pxd":278 * * * cdef class random_sample: # <<<<<<<<<<<<<< * cdef object iter_seq * cdef object prob */ struct __pyx_obj_7cytoolz_9itertoolz_random_sample { PyObject_HEAD PyObject *iter_seq; PyObject *prob; PyObject *random_func; }; /* "cytoolz/itertoolz.pyx":1350 * left_default, right_default) * * cdef class _join: # <<<<<<<<<<<<<< * def __cinit__(self, * object leftkey, object leftseq, */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__join { PyObject *(*rightkey)(struct __pyx_obj_7cytoolz_9itertoolz__join *); }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__join *__pyx_vtabptr_7cytoolz_9itertoolz__join; /* "cytoolz/itertoolz.pyx":1527 * * * cdef class _inner_join(_join): # <<<<<<<<<<<<<< * def __next__(self): * cdef PyObject *obj = NULL */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join { struct __pyx_vtabstruct_7cytoolz_9itertoolz__join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join *__pyx_vtabptr_7cytoolz_9itertoolz__inner_join; /* "cytoolz/itertoolz.pyx":1378 * * * cdef class _right_outer_join(_join): # <<<<<<<<<<<<<< * def __next__(self): * cdef PyObject *obj */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join { struct __pyx_vtabstruct_7cytoolz_9itertoolz__join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join *__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join; /* "cytoolz/itertoolz.pyx":1471 * * * cdef class _left_outer_join(_join): # <<<<<<<<<<<<<< * def __next__(self): * cdef PyObject *obj */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join { struct __pyx_vtabstruct_7cytoolz_9itertoolz__join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join *__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join; /* "cytoolz/itertoolz.pyx":1415 * * * cdef class _outer_join(_join): # <<<<<<<<<<<<<< * def __next__(self): * cdef PyObject *obj */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join { struct __pyx_vtabstruct_7cytoolz_9itertoolz__join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join *__pyx_vtabptr_7cytoolz_9itertoolz__outer_join; /* "cytoolz/itertoolz.pyx":1542 * * * cdef class _inner_join_key(_inner_join): # <<<<<<<<<<<<<< * cdef object rightkey(self): * return self._rightkey(self.right) */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_key { struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_key *__pyx_vtabptr_7cytoolz_9itertoolz__inner_join_key; /* "cytoolz/itertoolz.pyx":1547 * * * cdef class _inner_join_index(_inner_join): # <<<<<<<<<<<<<< * cdef object rightkey(self): * return self.right[self._rightkey] */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_index { struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_index *__pyx_vtabptr_7cytoolz_9itertoolz__inner_join_index; /* "cytoolz/itertoolz.pyx":1552 * * * cdef class _inner_join_indices(_inner_join): # <<<<<<<<<<<<<< * cdef object rightkey(self): * keyval = PyTuple_New(self.N) */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_indices { struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_indices *__pyx_vtabptr_7cytoolz_9itertoolz__inner_join_indices; /* "cytoolz/itertoolz.pyx":1394 * * * cdef class _right_outer_join_key(_right_outer_join): # <<<<<<<<<<<<<< * cdef object rightkey(self): * return self._rightkey(self.right) */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_key { struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_key *__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_key; /* "cytoolz/itertoolz.pyx":1399 * * * cdef class _right_outer_join_index(_right_outer_join): # <<<<<<<<<<<<<< * cdef object rightkey(self): * return self.right[self._rightkey] */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_index { struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_index *__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_index; /* "cytoolz/itertoolz.pyx":1404 * * * cdef class _right_outer_join_indices(_right_outer_join): # <<<<<<<<<<<<<< * cdef object rightkey(self): * keyval = PyTuple_New(self.N) */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_indices { struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_indices *__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_indices; /* "cytoolz/itertoolz.pyx":1506 * * * cdef class _left_outer_join_key(_left_outer_join): # <<<<<<<<<<<<<< * cdef object rightkey(self): * return self._rightkey(self.right) */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_key { struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_key *__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_key; /* "cytoolz/itertoolz.pyx":1511 * * * cdef class _left_outer_join_index(_left_outer_join): # <<<<<<<<<<<<<< * cdef object rightkey(self): * return self.right[self._rightkey] */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_index { struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_index *__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_index; /* "cytoolz/itertoolz.pyx":1516 * * * cdef class _left_outer_join_indices(_left_outer_join): # <<<<<<<<<<<<<< * cdef object rightkey(self): * keyval = PyTuple_New(self.N) */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_indices { struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_indices *__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_indices; /* "cytoolz/itertoolz.pyx":1450 * * * cdef class _outer_join_key(_outer_join): # <<<<<<<<<<<<<< * cdef object rightkey(self): * return self._rightkey(self.right) */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_key { struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_key *__pyx_vtabptr_7cytoolz_9itertoolz__outer_join_key; /* "cytoolz/itertoolz.pyx":1455 * * * cdef class _outer_join_index(_outer_join): # <<<<<<<<<<<<<< * cdef object rightkey(self): * return self.right[self._rightkey] */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_index { struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_index *__pyx_vtabptr_7cytoolz_9itertoolz__outer_join_index; /* "cytoolz/itertoolz.pyx":1460 * * * cdef class _outer_join_indices(_outer_join): # <<<<<<<<<<<<<< * cdef object rightkey(self): * keyval = PyTuple_New(self.N) */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_indices { struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_indices *__pyx_vtabptr_7cytoolz_9itertoolz__outer_join_indices; /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #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); #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 #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) /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* IterNext.proto */ #define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL) static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *); /* PyCFunctionFastCall.proto */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); #else #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCall2Args.proto */ static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } #define __Pyx_GetModuleGlobalNameUncached(var, name) {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* CallableCheck.proto */ #if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3 #define __Pyx_PyCallable_Check(obj) ((obj)->ob_type->tp_call != NULL) #else #define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj) #endif /* GetItemInt.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 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); /* ObjectGetItem.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); #else #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) #endif /* None.proto */ static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* SliceObject.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice( PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop, PyObject** py_start, PyObject** py_stop, PyObject** py_slice, int has_cstart, int has_cstop, int wraparound); /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* KeywordStringCheck.proto */ static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /* PyDictContains.proto */ static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) { int result = PyDict_Contains(dict, item); return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* DictGetItem.proto */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key); #define __Pyx_PyObject_Dict_GetItem(obj, name)\ (likely(PyDict_CheckExact(obj)) ?\ __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name)) #else #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name) #endif /* ListCompAppend.proto */ #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { PyListObject* L = (PyListObject*) list; Py_ssize_t len = Py_SIZE(list); if (likely(L->allocated > len)) { Py_INCREF(x); 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 /* PyObjectCallNoArg.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif /* IncludeStringH.proto */ #include /* BytesEquals.proto */ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /* UnicodeEquals.proto */ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /* StrEquals.proto */ #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals #else #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals #endif /* GetAttr.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /* HasAttr.proto */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *); /* ArgTypeTest.proto */ #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ __Pyx__ArgTypeTest(obj, type, name, exact)) static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); /* GetAttr3.proto */ static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /* pyfrozenset_new.proto */ static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it); /* PySetContains.proto */ static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq); /* dict_getitem_default.proto */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value); /* UnpackUnboundCMethod.proto */ typedef struct { PyObject *type; PyObject **method_name; PyCFunction func; PyObject *method; int flag; } __Pyx_CachedCFunction; /* CallUnboundCMethod1.proto */ static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg); #else #define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg) #endif /* CallUnboundCMethod2.proto */ static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2); #else #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2) #endif /* pyobject_as_double.proto */ static double __Pyx__PyObject_AsDouble(PyObject* obj); #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 /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ static int __Pyx_setup_reduce(PyObject* type_obj); /* SetVTable.proto */ static int __Pyx_SetVtable(PyObject *dict, void *vtable); /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto #define __PYX_HAVE_RT_ImportType_proto enum __Pyx_ImportType_CheckSize { __Pyx_ImportType_CheckSize_Error = 0, __Pyx_ImportType_CheckSize_Warn = 1, __Pyx_ImportType_CheckSize_Ignore = 2 }; static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); #endif /* FetchCommonType.proto */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); /* CythonFunction.proto */ #define __Pyx_CyFunction_USED 1 #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; #if PY_VERSION_HEX < 0x030500A0 PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; void *defaults; int defaults_pyobjects; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) #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); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; int code_line; } __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); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); static PyObject *__pyx_f_7cytoolz_9itertoolz_5_join_rightkey(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__join *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_21_right_outer_join_key_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_23_right_outer_join_index_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_25_right_outer_join_indices_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_15_outer_join_key_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_17_outer_join_index_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_19_outer_join_indices_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_20_left_outer_join_key_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_22_left_outer_join_index_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_24_left_outer_join_indices_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_15_inner_join_key_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_17_inner_join_index_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_19_inner_join_indices_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices *__pyx_v_self); /* proto*/ /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.type' */ static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; /* Module declarations from 'cpython' */ /* Module declarations from 'cpython.object' */ /* Module declarations from 'cpython.dict' */ /* Module declarations from 'cpython.exc' */ /* Module declarations from 'cpython.list' */ /* Module declarations from 'cpython.ref' */ /* Module declarations from 'cpython.sequence' */ /* Module declarations from 'cpython.set' */ /* Module declarations from 'cpython.tuple' */ /* Module declarations from 'cytoolz.cpython' */ /* Module declarations from 'cytoolz.itertoolz' */ static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_remove = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_accumulate = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__merge_sorted = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__merge_sorted_key = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_interleave = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__unique_key = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__unique_identity = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_interpose = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_iterate = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_sliding_window = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_partition_all = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__pluck_index = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__pluck_index_default = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__pluck_list = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__pluck_list_default = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__getter_index = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__getter_list = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__getter_null = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__join = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__inner_join = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__right_outer_join = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__left_outer_join = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__outer_join = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__inner_join_key = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__inner_join_index = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__inner_join_indices = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__right_outer_join_key = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__right_outer_join_index = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__right_outer_join_indices = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__left_outer_join_key = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__left_outer_join_index = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__left_outer_join_indices = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__outer_join_key = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__outer_join_index = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__outer_join_indices = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__diff_key = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__diff_identity = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_random_sample = 0; static PyObject *__pyx_v_7cytoolz_9itertoolz__get_exceptions = 0; static PyObject *__pyx_v_7cytoolz_9itertoolz__get_list_exc = 0; static PyObject *__pyx_f_7cytoolz_9itertoolz_groupby(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_c_merge_sorted(PyObject *, struct __pyx_opt_args_7cytoolz_9itertoolz_c_merge_sorted *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_unique(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_unique *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_isiterable(PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_isdistinct(PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_take(Py_ssize_t, PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_tail(Py_ssize_t, PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_drop(Py_ssize_t, PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_take_nth(Py_ssize_t, PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_first(PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_second(PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_nth(Py_ssize_t, PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_last(PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_rest(PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_get(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_get *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_cons(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_concat(PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_mapcat(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_frequencies(PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_reduceby(PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_reduceby *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_partition(Py_ssize_t, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_partition *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_count(PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_pluck(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_pluck *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_getter(PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_join(PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_join *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_c_diff(PyObject *, struct __pyx_opt_args_7cytoolz_9itertoolz_c_diff *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_topk(Py_ssize_t, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_topk *__pyx_optional_args); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_peek(PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_peekn(Py_ssize_t, PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_identity(PyObject *, int __pyx_skip_dispatch); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7cytoolz_9itertoolz__groupby_core(PyObject *, PyObject *, PyObject *); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz__merge_sorted_binary(PyObject *); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz__merge_sorted_binary_key(PyObject *, PyObject *); /*proto*/ static CYTHON_INLINE PyObject *__pyx_f_7cytoolz_9itertoolz__reduceby_core(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int, int); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz___pyx_unpickle__getter_null__set_state(struct __pyx_obj_7cytoolz_9itertoolz__getter_null *, PyObject *); /*proto*/ #define __Pyx_MODULE_NAME "cytoolz.itertoolz" extern int __pyx_module_is_main_cytoolz__itertoolz; int __pyx_module_is_main_cytoolz__itertoolz = 0; /* Implementation of 'cytoolz.itertoolz' */ static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_KeyError; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_StopIteration; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_enumerate; static PyObject *__pyx_builtin_max; static const char __pyx_k_N[] = "N"; static const char __pyx_k_k[] = "k"; static const char __pyx_k_n[] = "n"; static const char __pyx_k_x[] = "x"; static const char __pyx_k_el[] = "el"; static const char __pyx_k_all[] = "__all__"; static const char __pyx_k_get[] = "get"; static const char __pyx_k_ind[] = "ind"; static const char __pyx_k_key[] = "key"; static const char __pyx_k_len[] = "__len__"; static const char __pyx_k_map[] = "map"; static const char __pyx_k_max[] = "max"; static const char __pyx_k_new[] = "__new__"; static const char __pyx_k_nth[] = "nth"; static const char __pyx_k_pad[] = "pad"; static const char __pyx_k_seq[] = "seq"; static const char __pyx_k_zip[] = "zip"; static const char __pyx_k_cons[] = "cons"; static const char __pyx_k_dict[] = "__dict__"; static const char __pyx_k_diff[] = "diff"; static const char __pyx_k_drop[] = "drop"; static const char __pyx_k_func[] = "func"; static const char __pyx_k_init[] = "init"; static const char __pyx_k_join[] = "_join"; static const char __pyx_k_last[] = "last"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_peek[] = "peek"; static const char __pyx_k_prob[] = "prob"; static const char __pyx_k_rest[] = "rest"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_seq1[] = "seq1"; static const char __pyx_k_seq2[] = "seq2"; static const char __pyx_k_seqs[] = "seqs"; static const char __pyx_k_sort[] = "sort"; static const char __pyx_k_tail[] = "tail"; static const char __pyx_k_take[] = "take"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_topk[] = "topk"; static const char __pyx_k_val2[] = "val2"; static const char __pyx_k_binop[] = "binop"; static const char __pyx_k_chain[] = "chain"; static const char __pyx_k_count[] = "count"; static const char __pyx_k_deque[] = "deque"; static const char __pyx_k_first[] = "first"; static const char __pyx_k_heapq[] = "heapq"; static const char __pyx_k_index[] = "index"; static const char __pyx_k_peekn[] = "peekn"; static const char __pyx_k_pluck[] = "pluck"; static const char __pyx_k_range[] = "range"; static const char __pyx_k_state[] = "state"; static const char __pyx_k_Random[] = "Random"; static const char __pyx_k_concat[] = "concat"; static const char __pyx_k_dict_2[] = "_dict"; static const char __pyx_k_getter[] = "getter"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_islice[] = "islice"; static const char __pyx_k_join_2[] = "join"; static const char __pyx_k_kwargs[] = "kwargs"; static const char __pyx_k_mapcat[] = "mapcat"; static const char __pyx_k_no_pad[] = "no_pad"; static const char __pyx_k_pickle[] = "pickle"; static const char __pyx_k_random[] = "random"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_remove[] = "remove"; static const char __pyx_k_second[] = "second"; static const char __pyx_k_unique[] = "unique"; static const char __pyx_k_update[] = "update"; static const char __pyx_k_concatv[] = "concatv"; static const char __pyx_k_default[] = "default"; static const char __pyx_k_groupby[] = "groupby"; static const char __pyx_k_heapify[] = "heapify"; static const char __pyx_k_heappop[] = "heappop"; static const char __pyx_k_initial[] = "initial"; static const char __pyx_k_iterate[] = "iterate"; static const char __pyx_k_leftkey[] = "leftkey"; static const char __pyx_k_leftseq[] = "leftseq"; static const char __pyx_k_no__pad[] = "__no__pad__"; static const char __pyx_k_reverse[] = "reverse"; static const char __pyx_k_KeyError[] = "KeyError"; static const char __pyx_k_diff_key[] = "_diff_key"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_identity[] = "identity"; static const char __pyx_k_operator[] = "operator"; static const char __pyx_k_pyx_type[] = "__pyx_type"; static const char __pyx_k_reduceby[] = "reduceby"; static const char __pyx_k_rightkey[] = "rightkey"; static const char __pyx_k_rightseq[] = "rightseq"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_take_nth[] = "take_nth"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_enumerate[] = "enumerate"; static const char __pyx_k_fillvalue[] = "fillvalue"; static const char __pyx_k_interpose[] = "interpose"; static const char __pyx_k_itertools[] = "itertools"; static const char __pyx_k_partition[] = "partition"; static const char __pyx_k_predicate[] = "predicate"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_IndexError[] = "IndexError"; static const char __pyx_k_ValueError[] = "ValueError"; static const char __pyx_k_accumulate[] = "accumulate"; static const char __pyx_k_inner_join[] = "_inner_join"; static const char __pyx_k_interleave[] = "interleave"; static const char __pyx_k_isdistinct[] = "isdistinct"; static const char __pyx_k_isiterable[] = "isiterable"; static const char __pyx_k_itemgetter[] = "itemgetter"; static const char __pyx_k_no_default[] = "no_default"; static const char __pyx_k_outer_join[] = "_outer_join"; static const char __pyx_k_pluck_list[] = "_pluck_list"; static const char __pyx_k_pyx_result[] = "__pyx_result"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_unique_key[] = "_unique_key"; static const char __pyx_k_PickleError[] = "PickleError"; static const char __pyx_k_collections[] = "collections"; static const char __pyx_k_frequencies[] = "frequencies"; static const char __pyx_k_getter_list[] = "_getter_list"; static const char __pyx_k_getter_null[] = "_getter_null"; static const char __pyx_k_heapreplace[] = "heapreplace"; static const char __pyx_k_no__default[] = "__no__default__"; static const char __pyx_k_pluck_index[] = "_pluck_index"; static const char __pyx_k_zip_longest[] = "zip_longest"; static const char __pyx_k_get_line_619[] = "get (line 619)"; static const char __pyx_k_getter_index[] = "_getter_index"; static const char __pyx_k_left_default[] = "left_default"; static const char __pyx_k_merge_sorted[] = "_merge_sorted"; static const char __pyx_k_nth_line_573[] = "nth (line 573)"; static const char __pyx_k_pyx_checksum[] = "__pyx_checksum"; static const char __pyx_k_random_state[] = "random_state"; static const char __pyx_k_stringsource[] = "stringsource"; static const char __pyx_k_use_setstate[] = "use_setstate"; static const char __pyx_k_StopIteration[] = "StopIteration"; static const char __pyx_k_cons_line_740[] = "cons (line 740)"; static const char __pyx_k_cytoolz_utils[] = "cytoolz.utils"; static const char __pyx_k_diff_identity[] = "_diff_identity"; static const char __pyx_k_drop_line_517[] = "drop (line 517)"; static const char __pyx_k_from_iterable[] = "from_iterable"; static const char __pyx_k_last_line_591[] = "last (line 591)"; static const char __pyx_k_partition_all[] = "partition_all"; static const char __pyx_k_random_sample[] = "random_sample"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_right_default[] = "right_default"; static const char __pyx_k_tail_line_501[] = "tail (line 501)"; static const char __pyx_k_take_line_487[] = "take (line 487)"; static const char __pyx_k_diff_line_1620[] = "diff (line 1620)"; static const char __pyx_k_first_line_551[] = "first (line 551)"; static const char __pyx_k_inner_join_key[] = "_inner_join_key"; static const char __pyx_k_join_line_1247[] = "join (line 1247)"; static const char __pyx_k_merge_sorted_2[] = "merge_sorted"; static const char __pyx_k_outer_join_key[] = "_outer_join_key"; static const char __pyx_k_peek_line_1718[] = "peek (line 1718)"; static const char __pyx_k_sliding_window[] = "sliding_window"; static const char __pyx_k_topk_line_1646[] = "topk (line 1646)"; static const char __pyx_k_concat_line_697[] = "concat (line 697)"; static const char __pyx_k_left_outer_join[] = "_left_outer_join"; static const char __pyx_k_mapcat_line_729[] = "mapcat (line 729)"; static const char __pyx_k_peekn_line_1737[] = "peekn (line 1737)"; static const char __pyx_k_pluck_line_1171[] = "pluck (line 1171)"; static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; static const char __pyx_k_second_line_561[] = "second (line 561)"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_unique_identity[] = "_unique_identity"; static const char __pyx_k_unique_line_423[] = "unique (line 423)"; static const char __pyx_k_concatv_line_716[] = "concatv (line 716)"; static const char __pyx_k_groupby_line_118[] = "groupby (line 118)"; static const char __pyx_k_inner_join_index[] = "_inner_join_index"; static const char __pyx_k_merge_sorted_key[] = "_merge_sorted_key"; static const char __pyx_k_outer_join_index[] = "_outer_join_index"; static const char __pyx_k_right_outer_join[] = "_right_outer_join"; static const char __pyx_k_cytoolz_itertoolz[] = "cytoolz.itertoolz"; static const char __pyx_k_reduceby_line_817[] = "reduceby (line 817)"; static const char __pyx_k_take_nth_line_541[] = "take_nth (line 541)"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_inner_join_indices[] = "_inner_join_indices"; static const char __pyx_k_outer_join_indices[] = "_outer_join_indices"; static const char __pyx_k_partition_line_995[] = "partition (line 995)"; static const char __pyx_k_pluck_list_default[] = "_pluck_list_default"; static const char __pyx_k_isdistinct_line_462[] = "isdistinct (line 462)"; static const char __pyx_k_isiterable_line_443[] = "isiterable (line 443)"; static const char __pyx_k_left_outer_join_key[] = "_left_outer_join_key"; static const char __pyx_k_pluck_index_default[] = "_pluck_index_default"; static const char __pyx_k_frequencies_line_780[] = "frequencies (line 780)"; static const char __pyx_k_join___reduce_cython[] = "_join.__reduce_cython__"; static const char __pyx_k_right_outer_join_key[] = "_right_outer_join_key"; static const char __pyx_k_cytoolz_compatibility[] = "cytoolz.compatibility"; static const char __pyx_k_cytoolz_itertoolz_pyx[] = "cytoolz/itertoolz.pyx"; static const char __pyx_k_left_outer_join_index[] = "_left_outer_join_index"; static const char __pyx_k_merge_sorted_line_295[] = "merge_sorted (line 295)"; static const char __pyx_k_join___setstate_cython[] = "_join.__setstate_cython__"; static const char __pyx_k_remove___reduce_cython[] = "remove.__reduce_cython__"; static const char __pyx_k_right_outer_join_index[] = "_right_outer_join_index"; static const char __pyx_k_iterate___reduce_cython[] = "iterate.__reduce_cython__"; static const char __pyx_k_left_outer_join_indices[] = "_left_outer_join_indices"; static const char __pyx_k_diff_key___reduce_cython[] = "_diff_key.__reduce_cython__"; static const char __pyx_k_remove___setstate_cython[] = "remove.__setstate_cython__"; static const char __pyx_k_right_outer_join_indices[] = "_right_outer_join_indices"; static const char __pyx_k_interpose___reduce_cython[] = "interpose.__reduce_cython__"; static const char __pyx_k_iterate___setstate_cython[] = "iterate.__setstate_cython__"; static const char __pyx_k_pyx_unpickle__getter_null[] = "__pyx_unpickle__getter_null"; static const char __pyx_k_accumulate___reduce_cython[] = "accumulate.__reduce_cython__"; static const char __pyx_k_diff_key___setstate_cython[] = "_diff_key.__setstate_cython__"; static const char __pyx_k_inner_join___reduce_cython[] = "_inner_join.__reduce_cython__"; static const char __pyx_k_interleave___reduce_cython[] = "interleave.__reduce_cython__"; static const char __pyx_k_outer_join___reduce_cython[] = "_outer_join.__reduce_cython__"; static const char __pyx_k_pluck_list___reduce_cython[] = "_pluck_list.__reduce_cython__"; static const char __pyx_k_unique_key___reduce_cython[] = "_unique_key.__reduce_cython__"; static const char __pyx_k_getter_list___reduce_cython[] = "_getter_list.__reduce_cython__"; static const char __pyx_k_getter_null___reduce_cython[] = "_getter_null.__reduce_cython__"; static const char __pyx_k_interpose___setstate_cython[] = "interpose.__setstate_cython__"; static const char __pyx_k_pluck_index___reduce_cython[] = "_pluck_index.__reduce_cython__"; static const char __pyx_k_accumulate___setstate_cython[] = "accumulate.__setstate_cython__"; static const char __pyx_k_getter_index___reduce_cython[] = "_getter_index.__reduce_cython__"; static const char __pyx_k_inner_join___setstate_cython[] = "_inner_join.__setstate_cython__"; static const char __pyx_k_interleave___setstate_cython[] = "interleave.__setstate_cython__"; static const char __pyx_k_merge_sorted___reduce_cython[] = "_merge_sorted.__reduce_cython__"; static const char __pyx_k_outer_join___setstate_cython[] = "_outer_join.__setstate_cython__"; static const char __pyx_k_pluck_list___setstate_cython[] = "_pluck_list.__setstate_cython__"; static const char __pyx_k_unique_key___setstate_cython[] = "_unique_key.__setstate_cython__"; static const char __pyx_k_diff_identity___reduce_cython[] = "_diff_identity.__reduce_cython__"; static const char __pyx_k_getter_list___setstate_cython[] = "_getter_list.__setstate_cython__"; static const char __pyx_k_getter_null___setstate_cython[] = "_getter_null.__setstate_cython__"; static const char __pyx_k_partition_all___reduce_cython[] = "partition_all.__reduce_cython__"; static const char __pyx_k_pluck_index___setstate_cython[] = "_pluck_index.__setstate_cython__"; static const char __pyx_k_random_sample___reduce_cython[] = "random_sample.__reduce_cython__"; static const char __pyx_k_Apply_func_to_each_sequence_in[] = "\n Apply func to each sequence in seqs, concatenating results.\n\n >>> list(mapcat(lambda s: [c.upper() for c in s],\n ... [[\"a\", \"b\"], [\"c\", \"d\", \"e\"]]))\n ['A', 'B', 'C', 'D', 'E']\n "; static const char __pyx_k_Find_the_k_largest_elements_of[] = "\n Find the k largest elements of a sequence\n\n Operates lazily in ``n*log(k)`` time\n\n >>> topk(2, [1, 100, 10, 1000])\n (1000, 100)\n\n Use a key function to change sorted order\n\n >>> topk(2, ['Alice', 'Bob', 'Charlie', 'Dan'], key=len)\n ('Charlie', 'Alice')\n\n See also:\n heapq.nlargest\n "; static const char __pyx_k_Is_x_iterable_isiterable_1_2_3[] = "\n Is x iterable?\n\n >>> isiterable([1, 2, 3])\n True\n >>> isiterable('abc')\n True\n >>> isiterable(5)\n False\n "; static const char __pyx_k_Merge_and_sort_a_collection_of[] = "\n Merge and sort a collection of sorted collections\n\n This works lazily and only keeps one value from each iterable in memory.\n\n >>> list(merge_sorted([1, 3, 5], [2, 4, 6]))\n [1, 2, 3, 4, 5, 6]\n\n >>> ''.join(merge_sorted('abc', 'abc', 'abc'))\n 'aaabbbccc'\n\n The \"key\" function used to sort the input may be passed as a keyword.\n\n >>> list(merge_sorted([2, 3], [1, 3], key=lambda x: x // 3))\n [2, 1, 3, 3]\n "; static const char __pyx_k_Partition_sequence_into_tuples[] = "\n Partition sequence into tuples of length n\n\n >>> list(partition(2, [1, 2, 3, 4]))\n [(1, 2), (3, 4)]\n\n If the length of ``seq`` is not evenly divisible by ``n``, the final tuple\n is dropped if ``pad`` is not specified, or filled to length ``n`` by pad:\n\n >>> list(partition(2, [1, 2, 3, 4, 5]))\n [(1, 2), (3, 4)]\n\n >>> list(partition(2, [1, 2, 3, 4, 5], pad=None))\n [(1, 2), (3, 4), (5, None)]\n\n See Also:\n partition_all\n "; static const char __pyx_k_Perform_a_simultaneous_groupby[] = "\n Perform a simultaneous groupby and reduction\n\n The computation:\n\n >>> result = reduceby(key, binop, seq, init) # doctest: +SKIP\n\n is equivalent to the following:\n\n >>> def reduction(group): # doctest: +SKIP\n ... return reduce(binop, group, init) # doctest: +SKIP\n\n >>> groups = groupby(key, seq) # doctest: +SKIP\n >>> result = valmap(reduction, groups) # doctest: +SKIP\n\n But the former does not build the intermediate groups, allowing it to\n operate in much less space. This makes it suitable for larger datasets\n that do not fit comfortably in memory\n\n The ``init`` keyword argument is the default initialization of the\n reduction. This can be either a constant value like ``0`` or a callable\n like ``lambda : 0`` as might be used in ``defaultdict``.\n\n Simple Examples\n ---------------\n\n >>> from operator import add, mul\n >>> iseven = lambda x: x % 2 == 0\n\n >>> data = [1, 2, 3, 4, 5]\n\n >>> reduceby(iseven, add, data) # doctest: +SKIP\n {False: 9, True: 6}\n\n >>> reduceby(iseven, mul, data) # doctest: +SKIP\n {False: 15, True: 8}\n\n Complex Example\n ---------------\n\n >>> projects = [{'name': 'build roads', 'state': 'CA', 'cost': 1000000},\n ... {'name': 'fight crime', 'state': 'IL', 'cost': 100000},\n ... {'name': 'help farmers', 'state': 'IL', 'cost': 2000000},\n ... {'name': 'help farmers', 'state': 'CA', 'cost': 200000}]\n\n >>> reduceby('state', # doctest: +SKIP\n ... lambda acc, x: acc + x['cost'],\n ... projects, 0)\n {'CA': 1200000, 'IL': 2100000}\n\n Example Using ``init``\n ----------------------\n\n >>> def set_add(s, i):\n ... s.add(i)\n ... return s\n\n >>> reduceby(iseven, set_add, [1, 2, 3, 4, 1, 2, 3], set) # doctest: +SKIP\n {True: set([2, ""4]),\n False: set([1, 3])}\n "; static const char __pyx_k_Retrieve_the_next_element_of_a[] = "\n Retrieve the next element of a sequence\n\n Returns the first element and an iterable equivalent to the original\n sequence, still having the element retrieved.\n\n >>> seq = [0, 1, 2, 3, 4]\n >>> first, seq = peek(seq)\n >>> first\n 0\n >>> list(seq)\n [0, 1, 2, 3, 4]\n "; static const char __pyx_k_Return_only_unique_elements_of[] = "\n Return only unique elements of a sequence\n\n >>> tuple(unique((1, 2, 3)))\n (1, 2, 3)\n >>> tuple(unique((1, 2, 1, 3)))\n (1, 2, 3)\n\n Uniqueness can be defined by key keyword\n\n >>> tuple(unique(['cat', 'mouse', 'dog', 'hen'], key=len))\n ('cat', 'mouse')\n "; static const char __pyx_k_Return_those_items_that_differ[] = "\n Return those items that differ between sequences\n\n >>> list(diff([1, 2, 3], [1, 2, 10, 100]))\n [(3, 10)]\n\n Shorter sequences may be padded with a ``default`` value:\n\n >>> list(diff([1, 2, 3], [1, 2, 10, 100], default=None))\n [(3, 10), (None, 100)]\n\n A ``key`` function may also be applied to each item to use during\n comparisons:\n\n >>> list(diff(['apples', 'bananas'], ['Apples', 'Oranges'], key=str.lower))\n [('bananas', 'Oranges')]\n "; static const char __pyx_k_The_last_element_in_a_sequence[] = "\n The last element in a sequence\n\n >>> last('ABC')\n 'C'\n "; static const char __pyx_k_getter_index___setstate_cython[] = "_getter_index.__setstate_cython__"; static const char __pyx_k_inner_join_key___reduce_cython[] = "_inner_join_key.__reduce_cython__"; static const char __pyx_k_left_outer_join_index___reduce[] = "_left_outer_join_index.__reduce_cython__"; static const char __pyx_k_left_outer_join_key___setstate[] = "_left_outer_join_key.__setstate_cython__"; static const char __pyx_k_merge_sorted___setstate_cython[] = "_merge_sorted.__setstate_cython__"; static const char __pyx_k_outer_join_key___reduce_cython[] = "_outer_join_key.__reduce_cython__"; static const char __pyx_k_pluck_index_default___setstate[] = "_pluck_index_default.__setstate_cython__"; static const char __pyx_k_sliding_window___reduce_cython[] = "sliding_window.__reduce_cython__"; static const char __pyx_k_Add_el_to_beginning_of_possibly[] = "\n Add el to beginning of (possibly infinite) sequence seq.\n\n >>> list(cons(1, [2, 3]))\n [1, 2, 3]\n "; static const char __pyx_k_All_values_in_sequence_are_dist[] = "\n All values in sequence are distinct\n\n >>> isdistinct([1, 2, 3])\n True\n >>> isdistinct([1, 2, 1])\n False\n\n >>> isdistinct(\"Hello\")\n False\n >>> isdistinct(\"World\")\n True\n "; static const char __pyx_k_Concatenate_zero_or_more_iterab[] = "\n Concatenate zero or more iterables, any of which may be infinite.\n\n An infinite sequence will prevent the rest of the arguments from\n being included.\n\n We use chain.from_iterable rather than ``chain(*seqs)`` so that seqs\n can be a generator.\n\n >>> list(concat([[], [1], [2, 3]]))\n [1, 2, 3]\n\n See also:\n itertools.chain.from_iterable equivalent\n "; static const char __pyx_k_Every_nth_item_in_seq_list_take[] = "\n Every nth item in seq\n\n >>> list(take_nth(2, [10, 20, 30, 40, 50]))\n [10, 30, 50]\n "; static const char __pyx_k_Find_number_of_occurrences_of_e[] = "\n Find number of occurrences of each value in seq\n\n >>> frequencies(['cat', 'cat', 'ox', 'pig', 'pig', 'cat']) #doctest: +SKIP\n {'cat': 3, 'ox': 1, 'pig': 2}\n\n See Also:\n countby\n groupby\n "; static const char __pyx_k_Get_element_in_a_sequence_or_di[] = "\n Get element in a sequence or dict\n\n Provides standard indexing\n\n >>> get(1, 'ABC') # Same as 'ABC'[1]\n 'B'\n\n Pass a list to get multiple values\n\n >>> get([1, 2], 'ABC') # ('ABC'[1], 'ABC'[2])\n ('B', 'C')\n\n Works on any value that supports indexing/getitem\n For example here we see that it works with dictionaries\n\n >>> phonebook = {'Alice': '555-1234',\n ... 'Bob': '555-5678',\n ... 'Charlie':'555-9999'}\n >>> get('Alice', phonebook)\n '555-1234'\n\n >>> get(['Alice', 'Bob'], phonebook)\n ('555-1234', '555-5678')\n\n Provide a default for missing values\n\n >>> get(['Alice', 'Dennis'], phonebook, None)\n ('555-1234', None)\n\n See Also:\n pluck\n "; static const char __pyx_k_Group_a_collection_by_a_key_fun[] = "\n Group a collection by a key function\n\n >>> names = ['Alice', 'Bob', 'Charlie', 'Dan', 'Edith', 'Frank']\n >>> groupby(len, names) # doctest: +SKIP\n {3: ['Bob', 'Dan'], 5: ['Alice', 'Edith', 'Frank'], 7: ['Charlie']}\n\n >>> iseven = lambda x: x % 2 == 0\n >>> groupby(iseven, [1, 2, 3, 4, 5, 6, 7, 8]) # doctest: +SKIP\n {False: [1, 3, 5, 7], True: [2, 4, 6, 8]}\n\n Non-callable keys imply grouping on a member.\n\n >>> groupby('gender', [{'name': 'Alice', 'gender': 'F'},\n ... {'name': 'Bob', 'gender': 'M'},\n ... {'name': 'Charlie', 'gender': 'M'}]) # doctest:+SKIP\n {'F': [{'gender': 'F', 'name': 'Alice'}],\n 'M': [{'gender': 'M', 'name': 'Bob'},\n {'gender': 'M', 'name': 'Charlie'}]}\n\n Not to be confused with ``itertools.groupby``\n\n See Also:\n countby\n "; static const char __pyx_k_Join_two_sequences_on_common_at[] = "\n Join two sequences on common attributes\n\n This is a semi-streaming operation. The LEFT sequence is fully evaluated\n and placed into memory. The RIGHT sequence is evaluated lazily and so can\n be arbitrarily large.\n (Note: If right_default is defined, then unique keys of rightseq\n will also be stored in memory.)\n\n >>> friends = [('Alice', 'Edith'),\n ... ('Alice', 'Zhao'),\n ... ('Edith', 'Alice'),\n ... ('Zhao', 'Alice'),\n ... ('Zhao', 'Edith')]\n\n >>> cities = [('Alice', 'NYC'),\n ... ('Alice', 'Chicago'),\n ... ('Dan', 'Syndey'),\n ... ('Edith', 'Paris'),\n ... ('Edith', 'Berlin'),\n ... ('Zhao', 'Shanghai')]\n\n >>> # Vacation opportunities\n >>> # In what cities do people have friends?\n >>> result = join(second, friends,\n ... first, cities)\n >>> for ((a, b), (c, d)) in sorted(unique(result)):\n ... print((a, d))\n ('Alice', 'Berlin')\n ('Alice', 'Paris')\n ('Alice', 'Shanghai')\n ('Edith', 'Chicago')\n ('Edith', 'NYC')\n ('Zhao', 'Chicago')\n ('Zhao', 'NYC')\n ('Zhao', 'Berlin')\n ('Zhao', 'Paris')\n\n Specify outer joins with keyword arguments ``left_default`` and/or\n ``right_default``. Here is a full outer join in which unmatched elements\n are paired with None.\n\n >>> identity = lambda x: x\n >>> list(join(identity, [1, 2, 3],\n ... identity, [2, 3, 4],\n ... left_default=None, right_default=None))\n [(2, 2), (3, 3), (None, 4), (1, None)]\n\n Usually the key arguments are callables to be applied to the sequences. If\n the keys are not obviously callable then it is assumed that indexing was\n intended, e.g. the following is a legal change.\n The join is implemented as a hash join and the keys of leftseq must be\n hashable. Additionally, if right_default is defined, then key""s of rightseq\n must also be hashable.\n\n >>> # result = join(second, friends, first, cities)\n >>> result = join(1, friends, 0, cities) # doctest: +SKIP\n "; static const char __pyx_k_Retrieve_the_next_n_elements_of[] = "\n Retrieve the next n elements of a sequence\n\n Returns a tuple of the first n elements and an iterable equivalent\n to the original, still having the elements retrieved.\n\n >>> seq = [0, 1, 2, 3, 4]\n >>> first_two, seq = peekn(2, seq)\n >>> first_two\n (0, 1)\n >>> list(seq)\n [0, 1, 2, 3, 4]\n "; static const char __pyx_k_The_first_element_in_a_sequence[] = "\n The first element in a sequence\n\n >>> first('ABC')\n 'A'\n "; static const char __pyx_k_The_first_n_elements_of_a_seque[] = "\n The first n elements of a sequence\n\n >>> list(take(2, [10, 20, 30, 40, 50]))\n [10, 20]\n\n See Also:\n drop\n tail\n "; static const char __pyx_k_The_last_n_elements_of_a_sequen[] = "\n The last n elements of a sequence\n\n >>> tail(2, [10, 20, 30, 40, 50])\n [40, 50]\n\n See Also:\n drop\n take\n "; static const char __pyx_k_The_nth_element_in_a_sequence_n[] = "\n The nth element in a sequence\n\n >>> nth(1, 'ABC')\n 'B'\n "; static const char __pyx_k_The_second_element_in_a_sequenc[] = "\n The second element in a sequence\n\n >>> second('ABC')\n 'B'\n "; static const char __pyx_k_The_sequence_following_the_firs[] = "\n The sequence following the first n elements\n\n >>> list(drop(2, [10, 20, 30, 40, 50]))\n [30, 40, 50]\n\n See Also:\n take\n tail\n "; static const char __pyx_k_Variadic_version_of_concat_list[] = "\n Variadic version of concat\n\n >>> list(concatv([], [\"a\"], [\"b\", \"c\"]))\n ['a', 'b', 'c']\n\n See also:\n itertools.chain\n "; static const char __pyx_k_diff_identity___setstate_cython[] = "_diff_identity.__setstate_cython__"; static const char __pyx_k_inner_join_index___reduce_cytho[] = "_inner_join_index.__reduce_cython__"; static const char __pyx_k_inner_join_index___setstate_cyt[] = "_inner_join_index.__setstate_cython__"; static const char __pyx_k_inner_join_indices___reduce_cyt[] = "_inner_join_indices.__reduce_cython__"; static const char __pyx_k_inner_join_indices___setstate_c[] = "_inner_join_indices.__setstate_cython__"; static const char __pyx_k_inner_join_key___setstate_cytho[] = "_inner_join_key.__setstate_cython__"; static const char __pyx_k_left_outer_join___reduce_cython[] = "_left_outer_join.__reduce_cython__"; static const char __pyx_k_left_outer_join___setstate_cyth[] = "_left_outer_join.__setstate_cython__"; static const char __pyx_k_left_outer_join_index___setstat[] = "_left_outer_join_index.__setstate_cython__"; static const char __pyx_k_left_outer_join_indices___reduc[] = "_left_outer_join_indices.__reduce_cython__"; static const char __pyx_k_left_outer_join_indices___setst[] = "_left_outer_join_indices.__setstate_cython__"; static const char __pyx_k_left_outer_join_key___reduce_cy[] = "_left_outer_join_key.__reduce_cython__"; static const char __pyx_k_merge_sorted_key___reduce_cytho[] = "_merge_sorted_key.__reduce_cython__"; static const char __pyx_k_merge_sorted_key___setstate_cyt[] = "_merge_sorted_key.__setstate_cython__"; static const char __pyx_k_n_argument_for_drop_must_be_non[] = "n argument for drop() must be non-negative"; static const char __pyx_k_n_must_be_positive_when_indexin[] = "\"n\" must be positive when indexing an iterator"; static const char __pyx_k_outer_join_index___reduce_cytho[] = "_outer_join_index.__reduce_cython__"; static const char __pyx_k_outer_join_index___setstate_cyt[] = "_outer_join_index.__setstate_cython__"; static const char __pyx_k_outer_join_indices___reduce_cyt[] = "_outer_join_indices.__reduce_cython__"; static const char __pyx_k_outer_join_indices___setstate_c[] = "_outer_join_indices.__setstate_cython__"; static const char __pyx_k_outer_join_key___setstate_cytho[] = "_outer_join_key.__setstate_cython__"; static const char __pyx_k_partition_all___setstate_cython[] = "partition_all.__setstate_cython__"; static const char __pyx_k_pluck_index_default___reduce_cy[] = "_pluck_index_default.__reduce_cython__"; static const char __pyx_k_pluck_list_default___reduce_cyt[] = "_pluck_list_default.__reduce_cython__"; static const char __pyx_k_pluck_list_default___setstate_c[] = "_pluck_list_default.__setstate_cython__"; static const char __pyx_k_plucks_an_element_or_several_el[] = "\n plucks an element or several elements from each item in a sequence.\n\n ``pluck`` maps ``itertoolz.get`` over a sequence and returns one or more\n elements of each item in the sequence.\n\n This is equivalent to running `map(curried.get(ind), seqs)`\n\n ``ind`` can be either a single string/index or a list of strings/indices.\n ``seqs`` should be sequence containing sequences or dicts.\n\n e.g.\n\n >>> data = [{'id': 1, 'name': 'Cheese'}, {'id': 2, 'name': 'Pies'}]\n >>> list(pluck('name', data))\n ['Cheese', 'Pies']\n >>> list(pluck([0, 1], [[1, 2, 3], [4, 5, 7]]))\n [(1, 2), (4, 5)]\n\n See Also:\n get\n map\n "; static const char __pyx_k_random_sample___setstate_cython[] = "random_sample.__setstate_cython__"; static const char __pyx_k_right_outer_join___reduce_cytho[] = "_right_outer_join.__reduce_cython__"; static const char __pyx_k_right_outer_join___setstate_cyt[] = "_right_outer_join.__setstate_cython__"; static const char __pyx_k_right_outer_join_index___reduce[] = "_right_outer_join_index.__reduce_cython__"; static const char __pyx_k_right_outer_join_index___setsta[] = "_right_outer_join_index.__setstate_cython__"; static const char __pyx_k_right_outer_join_indices___redu[] = "_right_outer_join_indices.__reduce_cython__"; static const char __pyx_k_right_outer_join_indices___sets[] = "_right_outer_join_indices.__setstate_cython__"; static const char __pyx_k_right_outer_join_key___reduce_c[] = "_right_outer_join_key.__reduce_cython__"; static const char __pyx_k_right_outer_join_key___setstate[] = "_right_outer_join_key.__setstate_cython__"; static const char __pyx_k_unique_identity___reduce_cython[] = "_unique_identity.__reduce_cython__"; static const char __pyx_k_unique_identity___setstate_cyth[] = "_unique_identity.__setstate_cython__"; static const char __pyx_k_Incompatible_checksums_s_vs_0xd4[] = "Incompatible checksums (%s vs 0xd41d8cd = ())"; static const char __pyx_k_Too_few_sequences_given_min_2_re[] = "Too few sequences given (min 2 required)"; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; static const char __pyx_k_sliding_window___setstate_cython[] = "sliding_window.__setstate_cython__"; static PyObject *__pyx_kp_u_Add_el_to_beginning_of_possibly; static PyObject *__pyx_kp_u_All_values_in_sequence_are_dist; static PyObject *__pyx_kp_u_Apply_func_to_each_sequence_in; static PyObject *__pyx_kp_u_Concatenate_zero_or_more_iterab; static PyObject *__pyx_kp_u_Every_nth_item_in_seq_list_take; static PyObject *__pyx_kp_u_Find_number_of_occurrences_of_e; static PyObject *__pyx_kp_u_Find_the_k_largest_elements_of; static PyObject *__pyx_kp_u_Get_element_in_a_sequence_or_di; static PyObject *__pyx_kp_u_Group_a_collection_by_a_key_fun; static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xd4; static PyObject *__pyx_n_s_IndexError; static PyObject *__pyx_kp_u_Is_x_iterable_isiterable_1_2_3; static PyObject *__pyx_kp_u_Join_two_sequences_on_common_at; static PyObject *__pyx_n_s_KeyError; static PyObject *__pyx_kp_u_Merge_and_sort_a_collection_of; static PyObject *__pyx_n_s_N; static PyObject *__pyx_kp_u_Partition_sequence_into_tuples; static PyObject *__pyx_kp_u_Perform_a_simultaneous_groupby; static PyObject *__pyx_n_s_PickleError; static PyObject *__pyx_n_s_Random; static PyObject *__pyx_kp_u_Retrieve_the_next_element_of_a; static PyObject *__pyx_kp_u_Retrieve_the_next_n_elements_of; static PyObject *__pyx_kp_u_Return_only_unique_elements_of; static PyObject *__pyx_kp_u_Return_those_items_that_differ; static PyObject *__pyx_n_s_StopIteration; static PyObject *__pyx_kp_u_The_first_element_in_a_sequence; static PyObject *__pyx_kp_u_The_first_n_elements_of_a_seque; static PyObject *__pyx_kp_u_The_last_element_in_a_sequence; static PyObject *__pyx_kp_u_The_last_n_elements_of_a_sequen; static PyObject *__pyx_kp_u_The_nth_element_in_a_sequence_n; static PyObject *__pyx_kp_u_The_second_element_in_a_sequenc; static PyObject *__pyx_kp_u_The_sequence_following_the_firs; static PyObject *__pyx_kp_s_Too_few_sequences_given_min_2_re; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_ValueError; static PyObject *__pyx_kp_u_Variadic_version_of_concat_list; static PyObject *__pyx_n_s_accumulate; static PyObject *__pyx_n_s_accumulate___reduce_cython; static PyObject *__pyx_n_s_accumulate___setstate_cython; static PyObject *__pyx_n_s_all; static PyObject *__pyx_n_s_binop; static PyObject *__pyx_n_s_chain; static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_collections; static PyObject *__pyx_n_s_concat; static PyObject *__pyx_kp_u_concat_line_697; static PyObject *__pyx_n_s_concatv; static PyObject *__pyx_kp_u_concatv_line_716; static PyObject *__pyx_n_s_cons; static PyObject *__pyx_kp_u_cons_line_740; static PyObject *__pyx_n_s_count; static PyObject *__pyx_n_s_cytoolz_compatibility; static PyObject *__pyx_n_s_cytoolz_itertoolz; static PyObject *__pyx_kp_s_cytoolz_itertoolz_pyx; static PyObject *__pyx_n_s_cytoolz_utils; static PyObject *__pyx_n_s_default; static PyObject *__pyx_n_s_deque; static PyObject *__pyx_n_s_dict; static PyObject *__pyx_n_s_dict_2; static PyObject *__pyx_n_s_diff; static PyObject *__pyx_n_s_diff_identity; static PyObject *__pyx_n_s_diff_identity___reduce_cython; static PyObject *__pyx_n_s_diff_identity___setstate_cython; static PyObject *__pyx_n_s_diff_key; static PyObject *__pyx_n_s_diff_key___reduce_cython; static PyObject *__pyx_n_s_diff_key___setstate_cython; static PyObject *__pyx_kp_u_diff_line_1620; static PyObject *__pyx_n_s_drop; static PyObject *__pyx_kp_u_drop_line_517; static PyObject *__pyx_n_s_el; static PyObject *__pyx_n_s_enumerate; static PyObject *__pyx_n_s_fillvalue; static PyObject *__pyx_n_s_first; static PyObject *__pyx_kp_u_first_line_551; static PyObject *__pyx_n_s_frequencies; static PyObject *__pyx_kp_u_frequencies_line_780; static PyObject *__pyx_n_s_from_iterable; static PyObject *__pyx_n_s_func; static PyObject *__pyx_n_s_get; static PyObject *__pyx_kp_u_get_line_619; static PyObject *__pyx_n_s_getstate; static PyObject *__pyx_n_s_getter; static PyObject *__pyx_n_s_getter_index; static PyObject *__pyx_n_s_getter_index___reduce_cython; static PyObject *__pyx_n_s_getter_index___setstate_cython; static PyObject *__pyx_n_s_getter_list; static PyObject *__pyx_n_s_getter_list___reduce_cython; static PyObject *__pyx_n_s_getter_list___setstate_cython; static PyObject *__pyx_n_s_getter_null; static PyObject *__pyx_n_s_getter_null___reduce_cython; static PyObject *__pyx_n_s_getter_null___setstate_cython; static PyObject *__pyx_n_s_groupby; static PyObject *__pyx_kp_u_groupby_line_118; static PyObject *__pyx_n_s_heapify; static PyObject *__pyx_n_s_heappop; static PyObject *__pyx_n_s_heapq; static PyObject *__pyx_n_s_heapreplace; static PyObject *__pyx_n_s_identity; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_ind; static PyObject *__pyx_n_s_index; static PyObject *__pyx_n_s_init; static PyObject *__pyx_n_s_initial; static PyObject *__pyx_n_s_inner_join; static PyObject *__pyx_n_s_inner_join___reduce_cython; static PyObject *__pyx_n_s_inner_join___setstate_cython; static PyObject *__pyx_n_s_inner_join_index; static PyObject *__pyx_n_s_inner_join_index___reduce_cytho; static PyObject *__pyx_n_s_inner_join_index___setstate_cyt; static PyObject *__pyx_n_s_inner_join_indices; static PyObject *__pyx_n_s_inner_join_indices___reduce_cyt; static PyObject *__pyx_n_s_inner_join_indices___setstate_c; static PyObject *__pyx_n_s_inner_join_key; static PyObject *__pyx_n_s_inner_join_key___reduce_cython; static PyObject *__pyx_n_s_inner_join_key___setstate_cytho; static PyObject *__pyx_n_s_interleave; static PyObject *__pyx_n_s_interleave___reduce_cython; static PyObject *__pyx_n_s_interleave___setstate_cython; static PyObject *__pyx_n_s_interpose; static PyObject *__pyx_n_s_interpose___reduce_cython; static PyObject *__pyx_n_s_interpose___setstate_cython; static PyObject *__pyx_n_s_isdistinct; static PyObject *__pyx_kp_u_isdistinct_line_462; static PyObject *__pyx_n_s_isiterable; static PyObject *__pyx_kp_u_isiterable_line_443; static PyObject *__pyx_n_s_islice; static PyObject *__pyx_n_s_itemgetter; static PyObject *__pyx_n_s_iterate; static PyObject *__pyx_n_s_iterate___reduce_cython; static PyObject *__pyx_n_s_iterate___setstate_cython; static PyObject *__pyx_n_s_itertools; static PyObject *__pyx_n_s_join; static PyObject *__pyx_n_s_join_2; static PyObject *__pyx_n_s_join___reduce_cython; static PyObject *__pyx_n_s_join___setstate_cython; static PyObject *__pyx_kp_u_join_line_1247; static PyObject *__pyx_n_s_k; static PyObject *__pyx_n_s_key; static PyObject *__pyx_n_s_kwargs; static PyObject *__pyx_n_s_last; static PyObject *__pyx_kp_u_last_line_591; static PyObject *__pyx_n_s_left_default; static PyObject *__pyx_n_s_left_outer_join; static PyObject *__pyx_n_s_left_outer_join___reduce_cython; static PyObject *__pyx_n_s_left_outer_join___setstate_cyth; static PyObject *__pyx_n_s_left_outer_join_index; static PyObject *__pyx_n_s_left_outer_join_index___reduce; static PyObject *__pyx_n_s_left_outer_join_index___setstat; static PyObject *__pyx_n_s_left_outer_join_indices; static PyObject *__pyx_n_s_left_outer_join_indices___reduc; static PyObject *__pyx_n_s_left_outer_join_indices___setst; static PyObject *__pyx_n_s_left_outer_join_key; static PyObject *__pyx_n_s_left_outer_join_key___reduce_cy; static PyObject *__pyx_n_s_left_outer_join_key___setstate; static PyObject *__pyx_n_s_leftkey; static PyObject *__pyx_n_s_leftseq; static PyObject *__pyx_n_s_len; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_map; static PyObject *__pyx_n_s_mapcat; static PyObject *__pyx_kp_u_mapcat_line_729; static PyObject *__pyx_n_s_max; static PyObject *__pyx_n_s_merge_sorted; static PyObject *__pyx_n_s_merge_sorted_2; static PyObject *__pyx_n_s_merge_sorted___reduce_cython; static PyObject *__pyx_n_s_merge_sorted___setstate_cython; static PyObject *__pyx_n_s_merge_sorted_key; static PyObject *__pyx_n_s_merge_sorted_key___reduce_cytho; static PyObject *__pyx_n_s_merge_sorted_key___setstate_cyt; static PyObject *__pyx_kp_u_merge_sorted_line_295; static PyObject *__pyx_n_s_n; static PyObject *__pyx_kp_s_n_argument_for_drop_must_be_non; static PyObject *__pyx_kp_s_n_must_be_positive_when_indexin; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_new; static PyObject *__pyx_n_s_no__default; static PyObject *__pyx_n_s_no__pad; static PyObject *__pyx_n_s_no_default; static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; static PyObject *__pyx_n_s_no_pad; static PyObject *__pyx_n_s_nth; static PyObject *__pyx_kp_u_nth_line_573; static PyObject *__pyx_n_s_operator; static PyObject *__pyx_n_s_outer_join; static PyObject *__pyx_n_s_outer_join___reduce_cython; static PyObject *__pyx_n_s_outer_join___setstate_cython; static PyObject *__pyx_n_s_outer_join_index; static PyObject *__pyx_n_s_outer_join_index___reduce_cytho; static PyObject *__pyx_n_s_outer_join_index___setstate_cyt; static PyObject *__pyx_n_s_outer_join_indices; static PyObject *__pyx_n_s_outer_join_indices___reduce_cyt; static PyObject *__pyx_n_s_outer_join_indices___setstate_c; static PyObject *__pyx_n_s_outer_join_key; static PyObject *__pyx_n_s_outer_join_key___reduce_cython; static PyObject *__pyx_n_s_outer_join_key___setstate_cytho; static PyObject *__pyx_n_s_pad; static PyObject *__pyx_n_s_partition; static PyObject *__pyx_n_s_partition_all; static PyObject *__pyx_n_s_partition_all___reduce_cython; static PyObject *__pyx_n_s_partition_all___setstate_cython; static PyObject *__pyx_kp_u_partition_line_995; static PyObject *__pyx_n_s_peek; static PyObject *__pyx_kp_u_peek_line_1718; static PyObject *__pyx_n_s_peekn; static PyObject *__pyx_kp_u_peekn_line_1737; static PyObject *__pyx_n_s_pickle; static PyObject *__pyx_n_s_pluck; static PyObject *__pyx_n_s_pluck_index; static PyObject *__pyx_n_s_pluck_index___reduce_cython; static PyObject *__pyx_n_s_pluck_index___setstate_cython; static PyObject *__pyx_n_s_pluck_index_default; static PyObject *__pyx_n_s_pluck_index_default___reduce_cy; static PyObject *__pyx_n_s_pluck_index_default___setstate; static PyObject *__pyx_kp_u_pluck_line_1171; static PyObject *__pyx_n_s_pluck_list; static PyObject *__pyx_n_s_pluck_list___reduce_cython; static PyObject *__pyx_n_s_pluck_list___setstate_cython; static PyObject *__pyx_n_s_pluck_list_default; static PyObject *__pyx_n_s_pluck_list_default___reduce_cyt; static PyObject *__pyx_n_s_pluck_list_default___setstate_c; static PyObject *__pyx_kp_u_plucks_an_element_or_several_el; static PyObject *__pyx_n_s_predicate; static PyObject *__pyx_n_s_prob; static PyObject *__pyx_n_s_pyx_PickleError; static PyObject *__pyx_n_s_pyx_checksum; static PyObject *__pyx_n_s_pyx_result; static PyObject *__pyx_n_s_pyx_state; static PyObject *__pyx_n_s_pyx_type; static PyObject *__pyx_n_s_pyx_unpickle__getter_null; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_random; static PyObject *__pyx_n_s_random_sample; static PyObject *__pyx_n_s_random_sample___reduce_cython; static PyObject *__pyx_n_s_random_sample___setstate_cython; static PyObject *__pyx_n_s_random_state; static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_reduce; static PyObject *__pyx_n_s_reduce_cython; static PyObject *__pyx_n_s_reduce_ex; static PyObject *__pyx_n_s_reduceby; static PyObject *__pyx_kp_u_reduceby_line_817; static PyObject *__pyx_n_s_remove; static PyObject *__pyx_n_s_remove___reduce_cython; static PyObject *__pyx_n_s_remove___setstate_cython; static PyObject *__pyx_n_s_rest; static PyObject *__pyx_n_s_reverse; static PyObject *__pyx_n_s_right_default; static PyObject *__pyx_n_s_right_outer_join; static PyObject *__pyx_n_s_right_outer_join___reduce_cytho; static PyObject *__pyx_n_s_right_outer_join___setstate_cyt; static PyObject *__pyx_n_s_right_outer_join_index; static PyObject *__pyx_n_s_right_outer_join_index___reduce; static PyObject *__pyx_n_s_right_outer_join_index___setsta; static PyObject *__pyx_n_s_right_outer_join_indices; static PyObject *__pyx_n_s_right_outer_join_indices___redu; static PyObject *__pyx_n_s_right_outer_join_indices___sets; static PyObject *__pyx_n_s_right_outer_join_key; static PyObject *__pyx_n_s_right_outer_join_key___reduce_c; static PyObject *__pyx_n_s_right_outer_join_key___setstate; static PyObject *__pyx_n_s_rightkey; static PyObject *__pyx_n_s_rightseq; static PyObject *__pyx_n_s_second; static PyObject *__pyx_kp_u_second_line_561; static PyObject *__pyx_n_s_self; static PyObject *__pyx_n_s_seq; static PyObject *__pyx_n_s_seq1; static PyObject *__pyx_n_s_seq2; static PyObject *__pyx_n_s_seqs; static PyObject *__pyx_n_s_setstate; static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_n_s_sliding_window; static PyObject *__pyx_n_s_sliding_window___reduce_cython; static PyObject *__pyx_n_s_sliding_window___setstate_cython; static PyObject *__pyx_n_s_sort; static PyObject *__pyx_n_s_state; static PyObject *__pyx_kp_s_stringsource; static PyObject *__pyx_n_s_tail; static PyObject *__pyx_kp_u_tail_line_501; static PyObject *__pyx_n_s_take; static PyObject *__pyx_kp_u_take_line_487; static PyObject *__pyx_n_s_take_nth; static PyObject *__pyx_kp_u_take_nth_line_541; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_topk; static PyObject *__pyx_kp_u_topk_line_1646; static PyObject *__pyx_n_s_unique; static PyObject *__pyx_n_s_unique_identity; static PyObject *__pyx_n_s_unique_identity___reduce_cython; static PyObject *__pyx_n_s_unique_identity___setstate_cyth; static PyObject *__pyx_n_s_unique_key; static PyObject *__pyx_n_s_unique_key___reduce_cython; static PyObject *__pyx_n_s_unique_key___setstate_cython; static PyObject *__pyx_kp_u_unique_line_423; static PyObject *__pyx_n_s_update; static PyObject *__pyx_n_s_use_setstate; static PyObject *__pyx_n_s_val2; static PyObject *__pyx_n_s_x; static PyObject *__pyx_n_s_zip; static PyObject *__pyx_n_s_zip_longest; static PyObject *__pyx_pf_7cytoolz_9itertoolz_identity(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static int __pyx_pf_7cytoolz_9itertoolz_6remove___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_remove *__pyx_v_self, PyObject *__pyx_v_predicate, PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_6remove_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_remove *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_6remove_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_remove *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_6remove_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_remove *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_6remove_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_remove *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7cytoolz_9itertoolz_10accumulate___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_accumulate *__pyx_v_self, PyObject *__pyx_v_binop, PyObject *__pyx_v_seq, PyObject *__pyx_v_initial); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_10accumulate_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_accumulate *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_10accumulate_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_accumulate *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_10accumulate_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_accumulate *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_10accumulate_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_accumulate *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_2groupby(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_seq); /* proto */ static int __pyx_pf_7cytoolz_9itertoolz_13_merge_sorted___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *__pyx_v_self, PyObject *__pyx_v_seq1, PyObject *__pyx_v_seq2, PyObject *__pyx_v_val2); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_13_merge_sorted_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_13_merge_sorted_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_13_merge_sorted_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_13_merge_sorted_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *__pyx_v_self, PyObject *__pyx_v_seq1, PyObject *__pyx_v_seq2, PyObject *__pyx_v_val2, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_4merge_sorted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seqs, PyObject *__pyx_v_kwargs); /* proto */ static int __pyx_pf_7cytoolz_9itertoolz_10interleave___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_interleave *__pyx_v_self, PyObject *__pyx_v_seqs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_10interleave_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_interleave *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_10interleave_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_interleave *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_10interleave_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_interleave *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_10interleave_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_interleave *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7cytoolz_9itertoolz_11_unique_key___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__unique_key *__pyx_v_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_unique_key_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__unique_key *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_unique_key_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__unique_key *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_unique_key_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__unique_key *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_unique_key_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__unique_key *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7cytoolz_9itertoolz_16_unique_identity___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *__pyx_v_self, PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_16_unique_identity_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_16_unique_identity_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_16_unique_identity_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_16_unique_identity_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_6unique(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_8isiterable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_10isdistinct(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_12take(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_14tail(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_16drop(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_18take_nth(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_20first(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_22second(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_24nth(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_26last(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_28rest(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_30get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seq, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_32concat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seqs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_34concatv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seqs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_36mapcat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_seqs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_38cons(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_el, PyObject *__pyx_v_seq); /* proto */ static int __pyx_pf_7cytoolz_9itertoolz_9interpose___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_interpose *__pyx_v_self, PyObject *__pyx_v_el, PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_9interpose_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_interpose *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_9interpose_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_interpose *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_9interpose_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_interpose *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_9interpose_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_interpose *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_40frequencies(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_42reduceby(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_binop, PyObject *__pyx_v_seq, PyObject *__pyx_v_init); /* proto */ static int __pyx_pf_7cytoolz_9itertoolz_7iterate___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_iterate *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_7iterate_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_iterate *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_7iterate_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_iterate *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_7iterate_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_iterate *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_7iterate_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_iterate *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7cytoolz_9itertoolz_14sliding_window___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *__pyx_v_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_14sliding_window_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_14sliding_window_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_14sliding_window_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_14sliding_window_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_44partition(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq, PyObject *__pyx_v_pad); /* proto */ static int __pyx_pf_7cytoolz_9itertoolz_13partition_all___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_partition_all *__pyx_v_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_13partition_all_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_partition_all *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_13partition_all_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_partition_all *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_13partition_all_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_partition_all *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_13partition_all_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_partition_all *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_46count(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq); /* proto */ static int __pyx_pf_7cytoolz_9itertoolz_12_pluck_index___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *__pyx_v_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_pluck_index_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_pluck_index_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_pluck_index_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_pluck_index_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *__pyx_v_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7cytoolz_9itertoolz_11_pluck_list___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *__pyx_v_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_pluck_list_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_pluck_list_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_pluck_list_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_pluck_list_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *__pyx_v_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_48pluck(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs, PyObject *__pyx_v_default); /* proto */ static int __pyx_pf_7cytoolz_9itertoolz_13_getter_index___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__getter_index *__pyx_v_self, PyObject *__pyx_v_ind); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_13_getter_index_2__call__(struct __pyx_obj_7cytoolz_9itertoolz__getter_index *__pyx_v_self, PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_13_getter_index_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__getter_index *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_13_getter_index_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__getter_index *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7cytoolz_9itertoolz_12_getter_list___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__getter_list *__pyx_v_self, PyObject *__pyx_v_ind); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_getter_list_2__call__(struct __pyx_obj_7cytoolz_9itertoolz__getter_list *__pyx_v_self, PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_getter_list_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__getter_list *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_getter_list_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__getter_list *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_getter_null___call__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__getter_null *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_getter_null_2__reduce_cython__(struct __pyx_obj_7cytoolz_9itertoolz__getter_null *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_getter_null_4__setstate_cython__(struct __pyx_obj_7cytoolz_9itertoolz__getter_null *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_50getter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_52join(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_leftkey, PyObject *__pyx_v_leftseq, PyObject *__pyx_v_rightkey, PyObject *__pyx_v_rightseq, PyObject *__pyx_v_left_default, PyObject *__pyx_v_right_default); /* proto */ static int __pyx_pf_7cytoolz_9itertoolz_5_join___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__join *__pyx_v_self, PyObject *__pyx_v_leftkey, PyObject *__pyx_v_leftseq, PyObject *__pyx_v_rightkey, PyObject *__pyx_v_rightseq, PyObject *__pyx_v_left_default, PyObject *__pyx_v_right_default); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_5_join_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__join *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_5_join_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__join *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_5_join_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__join *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_right_outer_join___next__(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_right_outer_join_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_right_outer_join_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_21_right_outer_join_key___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_21_right_outer_join_key_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_23_right_outer_join_index___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_23_right_outer_join_index_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_25_right_outer_join_indices___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_25_right_outer_join_indices_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_outer_join___next__(struct __pyx_obj_7cytoolz_9itertoolz__outer_join *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_outer_join_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__outer_join *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_outer_join_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__outer_join *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_15_outer_join_key___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_15_outer_join_key_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_outer_join_index___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_outer_join_index_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_19_outer_join_indices___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_19_outer_join_indices_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_16_left_outer_join___next__(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_16_left_outer_join_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_16_left_outer_join_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_20_left_outer_join_key___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_20_left_outer_join_key_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_22_left_outer_join_index___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_22_left_outer_join_index_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_24_left_outer_join_indices___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_24_left_outer_join_indices_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_inner_join___next__(struct __pyx_obj_7cytoolz_9itertoolz__inner_join *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_inner_join_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__inner_join *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_inner_join_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__inner_join *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_15_inner_join_key___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_15_inner_join_key_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_inner_join_index___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_inner_join_index_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_19_inner_join_indices___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_19_inner_join_indices_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7cytoolz_9itertoolz_9_diff_key___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__diff_key *__pyx_v_self, PyObject *__pyx_v_seqs, PyObject *__pyx_v_key, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_9_diff_key_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__diff_key *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_9_diff_key_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__diff_key *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_9_diff_key_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__diff_key *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_9_diff_key_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__diff_key *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_7cytoolz_9itertoolz_14_diff_identity___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *__pyx_v_self, PyObject *__pyx_v_seqs, PyObject *__pyx_v_default); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_14_diff_identity_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_14_diff_identity_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_14_diff_identity_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_14_diff_identity_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_54diff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seqs, PyObject *__pyx_v_kwargs); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_56topk(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_k, PyObject *__pyx_v_seq, PyObject *__pyx_v_key); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_58peek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_60peekn(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq); /* proto */ static int __pyx_pf_7cytoolz_9itertoolz_13random_sample___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_random_sample *__pyx_v_self, PyObject *__pyx_v_prob, PyObject *__pyx_v_seq, PyObject *__pyx_v_random_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_13random_sample_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_random_sample *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_13random_sample_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_random_sample *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_13random_sample_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_random_sample *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_13random_sample_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_random_sample *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_7cytoolz_9itertoolz_62__pyx_unpickle__getter_null(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_remove(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_accumulate(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__merge_sorted(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__merge_sorted_key(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_interleave(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__unique_key(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__unique_identity(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_interpose(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_iterate(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_sliding_window(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_partition_all(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__pluck_index(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__pluck_index_default(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__pluck_list(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__pluck_list_default(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__getter_index(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__getter_list(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__getter_null(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__join(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__inner_join(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__right_outer_join(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__left_outer_join(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__outer_join(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__inner_join_key(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__inner_join_index(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__inner_join_indices(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__right_outer_join_key(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__right_outer_join_index(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__right_outer_join_indices(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__left_outer_join_key(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__left_outer_join_index(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__left_outer_join_indices(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__outer_join_key(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__outer_join_index(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__outer_join_indices(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__diff_key(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__diff_identity(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_random_sample(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, &__pyx_n_s_get, 0, 0, 0}; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_222419149; static PyObject *__pyx_k__37; static PyObject *__pyx_k__38; static PyObject *__pyx_k__73; static PyObject *__pyx_k__77; static PyObject *__pyx_k__80; 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__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__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__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__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__74; static PyObject *__pyx_tuple__75; static PyObject *__pyx_tuple__76; static PyObject *__pyx_tuple__78; static PyObject *__pyx_tuple__79; static PyObject *__pyx_tuple__81; static PyObject *__pyx_tuple__82; static PyObject *__pyx_tuple__83; static PyObject *__pyx_tuple__85; static PyObject *__pyx_tuple__87; static PyObject *__pyx_tuple__89; static PyObject *__pyx_tuple__91; static PyObject *__pyx_tuple__93; static PyObject *__pyx_tuple__95; static PyObject *__pyx_tuple__97; static PyObject *__pyx_tuple__99; static PyObject *__pyx_tuple__101; static PyObject *__pyx_tuple__103; static PyObject *__pyx_tuple__105; static PyObject *__pyx_tuple__107; static PyObject *__pyx_tuple__109; static PyObject *__pyx_tuple__111; static PyObject *__pyx_tuple__113; static PyObject *__pyx_tuple__115; static PyObject *__pyx_tuple__117; static PyObject *__pyx_tuple__119; static PyObject *__pyx_tuple__121; static PyObject *__pyx_tuple__123; static PyObject *__pyx_tuple__125; static PyObject *__pyx_tuple__127; static PyObject *__pyx_tuple__129; static PyObject *__pyx_tuple__131; static PyObject *__pyx_tuple__133; static PyObject *__pyx_tuple__135; static PyObject *__pyx_tuple__137; static PyObject *__pyx_tuple__139; static PyObject *__pyx_tuple__141; 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__163; static PyObject *__pyx_tuple__165; static PyObject *__pyx_tuple__167; static PyObject *__pyx_tuple__169; static PyObject *__pyx_tuple__171; static PyObject *__pyx_tuple__173; static PyObject *__pyx_tuple__175; static PyObject *__pyx_tuple__177; static PyObject *__pyx_tuple__179; static PyObject *__pyx_tuple__181; static PyObject *__pyx_tuple__183; static PyObject *__pyx_tuple__185; static PyObject *__pyx_tuple__187; static PyObject *__pyx_tuple__189; static PyObject *__pyx_tuple__191; static PyObject *__pyx_tuple__193; static PyObject *__pyx_tuple__195; static PyObject *__pyx_tuple__197; 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__293; static PyObject *__pyx_tuple__295; static PyObject *__pyx_tuple__297; static PyObject *__pyx_tuple__299; static PyObject *__pyx_codeobj__84; static PyObject *__pyx_codeobj__86; static PyObject *__pyx_codeobj__88; static PyObject *__pyx_codeobj__90; static PyObject *__pyx_codeobj__92; static PyObject *__pyx_codeobj__94; static PyObject *__pyx_codeobj__96; static PyObject *__pyx_codeobj__98; static PyObject *__pyx_codeobj__100; static PyObject *__pyx_codeobj__102; static PyObject *__pyx_codeobj__104; static PyObject *__pyx_codeobj__106; static PyObject *__pyx_codeobj__108; static PyObject *__pyx_codeobj__110; static PyObject *__pyx_codeobj__112; static PyObject *__pyx_codeobj__114; static PyObject *__pyx_codeobj__116; static PyObject *__pyx_codeobj__118; static PyObject *__pyx_codeobj__120; static PyObject *__pyx_codeobj__122; static PyObject *__pyx_codeobj__124; static PyObject *__pyx_codeobj__126; static PyObject *__pyx_codeobj__128; static PyObject *__pyx_codeobj__130; static PyObject *__pyx_codeobj__132; static PyObject *__pyx_codeobj__134; static PyObject *__pyx_codeobj__136; static PyObject *__pyx_codeobj__138; static PyObject *__pyx_codeobj__140; 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__162; static PyObject *__pyx_codeobj__164; static PyObject *__pyx_codeobj__166; static PyObject *__pyx_codeobj__168; static PyObject *__pyx_codeobj__170; static PyObject *__pyx_codeobj__172; static PyObject *__pyx_codeobj__174; static PyObject *__pyx_codeobj__176; static PyObject *__pyx_codeobj__178; static PyObject *__pyx_codeobj__180; static PyObject *__pyx_codeobj__182; static PyObject *__pyx_codeobj__184; static PyObject *__pyx_codeobj__186; static PyObject *__pyx_codeobj__188; static PyObject *__pyx_codeobj__190; static PyObject *__pyx_codeobj__192; static PyObject *__pyx_codeobj__194; static PyObject *__pyx_codeobj__196; static PyObject *__pyx_codeobj__198; 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__292; static PyObject *__pyx_codeobj__294; static PyObject *__pyx_codeobj__296; static PyObject *__pyx_codeobj__298; static PyObject *__pyx_codeobj__300; /* Late includes */ /* "cytoolz/itertoolz.pyx":30 * * * cpdef object identity(object x): # <<<<<<<<<<<<<< * return x * */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_1identity(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_identity(PyObject *__pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("identity", 0); /* "cytoolz/itertoolz.pyx":31 * * cpdef object identity(object x): * return x # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_x); __pyx_r = __pyx_v_x; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":30 * * * cpdef object identity(object x): # <<<<<<<<<<<<<< * return x * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_1identity(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_identity[] = "identity(x)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_1identity = {"identity", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_1identity, METH_O, __pyx_doc_7cytoolz_9itertoolz_identity}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_1identity(PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("identity (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_identity(__pyx_self, ((PyObject *)__pyx_v_x)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_identity(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("identity", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_identity(__pyx_v_x, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.identity", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":44 * [1, 3] * """ * def __cinit__(self, object predicate, object seq): # <<<<<<<<<<<<<< * self.predicate = predicate * self.iter_seq = iter(seq) */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9itertoolz_6remove_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9itertoolz_6remove_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_predicate = 0; PyObject *__pyx_v_seq = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_predicate,&__pyx_n_s_seq,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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_predicate)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 44, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 44, __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_predicate = values[0]; __pyx_v_seq = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 44, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.remove.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_6remove___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz_remove *)__pyx_v_self), __pyx_v_predicate, __pyx_v_seq); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9itertoolz_6remove___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_remove *__pyx_v_self, PyObject *__pyx_v_predicate, PyObject *__pyx_v_seq) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/itertoolz.pyx":45 * """ * def __cinit__(self, object predicate, object seq): * self.predicate = predicate # <<<<<<<<<<<<<< * self.iter_seq = iter(seq) * */ __Pyx_INCREF(__pyx_v_predicate); __Pyx_GIVEREF(__pyx_v_predicate); __Pyx_GOTREF(__pyx_v_self->predicate); __Pyx_DECREF(__pyx_v_self->predicate); __pyx_v_self->predicate = __pyx_v_predicate; /* "cytoolz/itertoolz.pyx":46 * def __cinit__(self, object predicate, object seq): * self.predicate = predicate * self.iter_seq = iter(seq) # <<<<<<<<<<<<<< * * def __iter__(self): */ __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->iter_seq); __Pyx_DECREF(__pyx_v_self->iter_seq); __pyx_v_self->iter_seq = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":44 * [1, 3] * """ * def __cinit__(self, object predicate, object seq): # <<<<<<<<<<<<<< * self.predicate = predicate * self.iter_seq = iter(seq) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz.remove.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":48 * self.iter_seq = iter(seq) * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_6remove_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_6remove_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_6remove_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz_remove *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_6remove_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_remove *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* "cytoolz/itertoolz.pyx":49 * * 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; /* "cytoolz/itertoolz.pyx":48 * self.iter_seq = iter(seq) * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":51 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef object val * val = next(self.iter_seq) */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_6remove_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_6remove_5__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_6remove_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz_remove *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_6remove_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_remove *__pyx_v_self) { PyObject *__pyx_v_val = 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; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":53 * def __next__(self): * cdef object val * val = next(self.iter_seq) # <<<<<<<<<<<<<< * while self.predicate(val): * val = next(self.iter_seq) */ __pyx_t_1 = __pyx_v_self->iter_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_val = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":54 * cdef object val * val = next(self.iter_seq) * while self.predicate(val): # <<<<<<<<<<<<<< * val = next(self.iter_seq) * return val */ while (1) { __Pyx_INCREF(__pyx_v_self->predicate); __pyx_t_1 = __pyx_v_self->predicate; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_val) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_val); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 54, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_4) break; /* "cytoolz/itertoolz.pyx":55 * val = next(self.iter_seq) * while self.predicate(val): * val = next(self.iter_seq) # <<<<<<<<<<<<<< * return val * */ __pyx_t_2 = __pyx_v_self->iter_seq; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; } /* "cytoolz/itertoolz.pyx":56 * while self.predicate(val): * val = next(self.iter_seq) * return val # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_val); __pyx_r = __pyx_v_val; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":51 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef object val * val = next(self.iter_seq) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.itertoolz.remove.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_6remove_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_6remove_6__reduce_cython__[] = "remove.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_6remove_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_6remove_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_6remove_6__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_6remove_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_6remove_6__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz_remove *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_6remove_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_remove *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz.remove.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_6remove_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_6remove_8__setstate_cython__[] = "remove.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_6remove_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_6remove_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_6remove_8__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_6remove_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_6remove_8__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz_remove *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_6remove_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_remove *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz.remove.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":88 * itertools.accumulate : In standard itertools for Python 3.2+ * """ * def __cinit__(self, object binop, object seq, object initial='__no__default__'): # <<<<<<<<<<<<<< * self.binop = binop * self.iter_seq = iter(seq) */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9itertoolz_10accumulate_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9itertoolz_10accumulate_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_binop = 0; PyObject *__pyx_v_seq = 0; PyObject *__pyx_v_initial = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_binop,&__pyx_n_s_seq,&__pyx_n_s_initial,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)__pyx_n_s_no__default); 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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_binop)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(0, 88, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_initial); 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_ERR(0, 88, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; 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_binop = values[0]; __pyx_v_seq = values[1]; __pyx_v_initial = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 88, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.accumulate.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_10accumulate___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz_accumulate *)__pyx_v_self), __pyx_v_binop, __pyx_v_seq, __pyx_v_initial); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9itertoolz_10accumulate___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_accumulate *__pyx_v_self, PyObject *__pyx_v_binop, PyObject *__pyx_v_seq, PyObject *__pyx_v_initial) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/itertoolz.pyx":89 * """ * def __cinit__(self, object binop, object seq, object initial='__no__default__'): * self.binop = binop # <<<<<<<<<<<<<< * self.iter_seq = iter(seq) * self.result = self # sentinel */ __Pyx_INCREF(__pyx_v_binop); __Pyx_GIVEREF(__pyx_v_binop); __Pyx_GOTREF(__pyx_v_self->binop); __Pyx_DECREF(__pyx_v_self->binop); __pyx_v_self->binop = __pyx_v_binop; /* "cytoolz/itertoolz.pyx":90 * def __cinit__(self, object binop, object seq, object initial='__no__default__'): * self.binop = binop * self.iter_seq = iter(seq) # <<<<<<<<<<<<<< * self.result = self # sentinel * self.initial = initial */ __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->iter_seq); __Pyx_DECREF(__pyx_v_self->iter_seq); __pyx_v_self->iter_seq = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":91 * self.binop = binop * self.iter_seq = iter(seq) * self.result = self # sentinel # <<<<<<<<<<<<<< * self.initial = initial * */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = ((PyObject *)__pyx_v_self); /* "cytoolz/itertoolz.pyx":92 * self.iter_seq = iter(seq) * self.result = self # sentinel * self.initial = initial # <<<<<<<<<<<<<< * * def __iter__(self): */ __Pyx_INCREF(__pyx_v_initial); __Pyx_GIVEREF(__pyx_v_initial); __Pyx_GOTREF(__pyx_v_self->initial); __Pyx_DECREF(__pyx_v_self->initial); __pyx_v_self->initial = __pyx_v_initial; /* "cytoolz/itertoolz.pyx":88 * itertools.accumulate : In standard itertools for Python 3.2+ * """ * def __cinit__(self, object binop, object seq, object initial='__no__default__'): # <<<<<<<<<<<<<< * self.binop = binop * self.iter_seq = iter(seq) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz.accumulate.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":94 * self.initial = initial * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_10accumulate_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_10accumulate_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_10accumulate_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz_accumulate *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_10accumulate_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_accumulate *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* "cytoolz/itertoolz.pyx":95 * * 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; /* "cytoolz/itertoolz.pyx":94 * self.initial = initial * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":97 * return self * * def __next__(self): # <<<<<<<<<<<<<< * if self.result is self: * if self.initial != no_default: */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_10accumulate_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_10accumulate_5__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_10accumulate_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz_accumulate *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_10accumulate_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_accumulate *__pyx_v_self) { 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_t_7; PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":98 * * def __next__(self): * if self.result is self: # <<<<<<<<<<<<<< * if self.initial != no_default: * self.result = self.initial */ __pyx_t_1 = (__pyx_v_self->result == ((PyObject *)__pyx_v_self)); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":99 * def __next__(self): * if self.result is self: * if self.initial != no_default: # <<<<<<<<<<<<<< * self.result = self.initial * else: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_no_default); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_v_self->initial, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __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_ERR(0, 99, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":100 * if self.result is self: * if self.initial != no_default: * self.result = self.initial # <<<<<<<<<<<<<< * else: * self.result = next(self.iter_seq) */ __pyx_t_4 = __pyx_v_self->initial; __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = __pyx_t_4; __pyx_t_4 = 0; /* "cytoolz/itertoolz.pyx":99 * def __next__(self): * if self.result is self: * if self.initial != no_default: # <<<<<<<<<<<<<< * self.result = self.initial * else: */ goto __pyx_L4; } /* "cytoolz/itertoolz.pyx":102 * self.result = self.initial * else: * self.result = next(self.iter_seq) # <<<<<<<<<<<<<< * else: * self.result = self.binop(self.result, next(self.iter_seq)) */ /*else*/ { __pyx_t_4 = __pyx_v_self->iter_seq; __Pyx_INCREF(__pyx_t_4); __pyx_t_3 = __Pyx_PyIter_Next(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 102, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = __pyx_t_3; __pyx_t_3 = 0; } __pyx_L4:; /* "cytoolz/itertoolz.pyx":98 * * def __next__(self): * if self.result is self: # <<<<<<<<<<<<<< * if self.initial != no_default: * self.result = self.initial */ goto __pyx_L3; } /* "cytoolz/itertoolz.pyx":104 * self.result = next(self.iter_seq) * else: * self.result = self.binop(self.result, next(self.iter_seq)) # <<<<<<<<<<<<<< * return self.result * */ /*else*/ { __pyx_t_4 = __pyx_v_self->iter_seq; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyIter_Next(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_INCREF(__pyx_v_self->binop); __pyx_t_4 = __pyx_v_self->binop; __pyx_t_6 = NULL; __pyx_t_7 = 0; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_7 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_self->result, __pyx_t_5}; __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_self->result, __pyx_t_5}; __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_INCREF(__pyx_v_self->result); __Pyx_GIVEREF(__pyx_v_self->result); PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_self->result); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->result); __Pyx_DECREF(__pyx_v_self->result); __pyx_v_self->result = __pyx_t_3; __pyx_t_3 = 0; } __pyx_L3:; /* "cytoolz/itertoolz.pyx":105 * else: * self.result = self.binop(self.result, next(self.iter_seq)) * return self.result # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->result); __pyx_r = __pyx_v_self->result; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":97 * return self * * def __next__(self): # <<<<<<<<<<<<<< * if self.result is self: * if self.initial != no_default: */ /* 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("cytoolz.itertoolz.accumulate.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_10accumulate_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_10accumulate_6__reduce_cython__[] = "accumulate.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_10accumulate_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_10accumulate_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_10accumulate_6__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_10accumulate_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_10accumulate_6__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz_accumulate *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_10accumulate_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_accumulate *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz.accumulate.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_10accumulate_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_10accumulate_8__setstate_cython__[] = "accumulate.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_10accumulate_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_10accumulate_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_10accumulate_8__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_10accumulate_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_10accumulate_8__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz_accumulate *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_10accumulate_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_accumulate *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz.accumulate.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":108 * * * cdef inline object _groupby_core(dict d, object key, object item): # <<<<<<<<<<<<<< * cdef PyObject *obj = PyDict_GetItem(d, key) * if obj is NULL: */ static CYTHON_INLINE PyObject *__pyx_f_7cytoolz_9itertoolz__groupby_core(PyObject *__pyx_v_d, PyObject *__pyx_v_key, PyObject *__pyx_v_item) { PyObject *__pyx_v_obj; PyObject *__pyx_v_val = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; __Pyx_RefNannySetupContext("_groupby_core", 0); /* "cytoolz/itertoolz.pyx":109 * * cdef inline object _groupby_core(dict d, object key, object item): * cdef PyObject *obj = PyDict_GetItem(d, key) # <<<<<<<<<<<<<< * if obj is NULL: * val = [] */ __pyx_v_obj = PyDict_GetItem(__pyx_v_d, __pyx_v_key); /* "cytoolz/itertoolz.pyx":110 * cdef inline object _groupby_core(dict d, object key, object item): * cdef PyObject *obj = PyDict_GetItem(d, key) * if obj is NULL: # <<<<<<<<<<<<<< * val = [] * PyList_Append(val, item) */ __pyx_t_1 = ((__pyx_v_obj == NULL) != 0); if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":111 * cdef PyObject *obj = PyDict_GetItem(d, key) * if obj is NULL: * val = [] # <<<<<<<<<<<<<< * PyList_Append(val, item) * PyDict_SetItem(d, key, val) */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_val = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":112 * if obj is NULL: * val = [] * PyList_Append(val, item) # <<<<<<<<<<<<<< * PyDict_SetItem(d, key, val) * else: */ __pyx_t_3 = PyList_Append(__pyx_v_val, __pyx_v_item); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 112, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":113 * val = [] * PyList_Append(val, item) * PyDict_SetItem(d, key, val) # <<<<<<<<<<<<<< * else: * PyList_Append(obj, item) */ __pyx_t_3 = PyDict_SetItem(__pyx_v_d, __pyx_v_key, __pyx_v_val); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 113, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":110 * cdef inline object _groupby_core(dict d, object key, object item): * cdef PyObject *obj = PyDict_GetItem(d, key) * if obj is NULL: # <<<<<<<<<<<<<< * val = [] * PyList_Append(val, item) */ goto __pyx_L3; } /* "cytoolz/itertoolz.pyx":115 * PyDict_SetItem(d, key, val) * else: * PyList_Append(obj, item) # <<<<<<<<<<<<<< * * */ /*else*/ { __pyx_t_3 = PyList_Append(((PyObject *)__pyx_v_obj), __pyx_v_item); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 115, __pyx_L1_error) } __pyx_L3:; /* "cytoolz/itertoolz.pyx":108 * * * cdef inline object _groupby_core(dict d, object key, object item): # <<<<<<<<<<<<<< * cdef PyObject *obj = PyDict_GetItem(d, key) * if obj is 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("cytoolz.itertoolz._groupby_core", __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; } /* "cytoolz/itertoolz.pyx":118 * * * cpdef dict groupby(object key, object seq): # <<<<<<<<<<<<<< * """ * Group a collection by a key function */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_3groupby(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_groupby(PyObject *__pyx_v_key, PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_v_d = 0; PyObject *__pyx_v_item = 0; PyObject *__pyx_v_keyval = 0; Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_N; PyObject *__pyx_v_val = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); 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; PyObject *__pyx_t_12; __Pyx_RefNannySetupContext("groupby", 0); /* "cytoolz/itertoolz.pyx":144 * countby * """ * cdef dict d = {} # <<<<<<<<<<<<<< * cdef object item, keyval * cdef Py_ssize_t i, N */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_d = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":147 * cdef object item, keyval * cdef Py_ssize_t i, N * if callable(key): # <<<<<<<<<<<<<< * for item in seq: * keyval = key(item) */ __pyx_t_2 = __Pyx_PyCallable_Check(__pyx_v_key); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 147, __pyx_L1_error) __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "cytoolz/itertoolz.pyx":148 * cdef Py_ssize_t i, N * if callable(key): * for item in seq: # <<<<<<<<<<<<<< * keyval = key(item) * _groupby_core(d, keyval, item) */ if (likely(PyList_CheckExact(__pyx_v_seq)) || PyTuple_CheckExact(__pyx_v_seq)) { __pyx_t_1 = __pyx_v_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 148, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 148, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 148, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_6); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_6); __pyx_t_6 = 0; /* "cytoolz/itertoolz.pyx":149 * if callable(key): * for item in seq: * keyval = key(item) # <<<<<<<<<<<<<< * _groupby_core(d, keyval, item) * elif isinstance(key, list): */ __Pyx_INCREF(__pyx_v_key); __pyx_t_7 = __pyx_v_key; __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_item); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_keyval, __pyx_t_6); __pyx_t_6 = 0; /* "cytoolz/itertoolz.pyx":150 * for item in seq: * keyval = key(item) * _groupby_core(d, keyval, item) # <<<<<<<<<<<<<< * elif isinstance(key, list): * N = PyList_GET_SIZE(key) */ __pyx_t_6 = __pyx_f_7cytoolz_9itertoolz__groupby_core(__pyx_v_d, __pyx_v_keyval, __pyx_v_item); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "cytoolz/itertoolz.pyx":148 * cdef Py_ssize_t i, N * if callable(key): * for item in seq: # <<<<<<<<<<<<<< * keyval = key(item) * _groupby_core(d, keyval, item) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":147 * cdef object item, keyval * cdef Py_ssize_t i, N * if callable(key): # <<<<<<<<<<<<<< * for item in seq: * keyval = key(item) */ goto __pyx_L3; } /* "cytoolz/itertoolz.pyx":151 * keyval = key(item) * _groupby_core(d, keyval, item) * elif isinstance(key, list): # <<<<<<<<<<<<<< * N = PyList_GET_SIZE(key) * for item in seq: */ __pyx_t_3 = PyList_Check(__pyx_v_key); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":152 * _groupby_core(d, keyval, item) * elif isinstance(key, list): * N = PyList_GET_SIZE(key) # <<<<<<<<<<<<<< * for item in seq: * keyval = PyTuple_New(N) */ __pyx_v_N = PyList_GET_SIZE(__pyx_v_key); /* "cytoolz/itertoolz.pyx":153 * elif isinstance(key, list): * N = PyList_GET_SIZE(key) * for item in seq: # <<<<<<<<<<<<<< * keyval = PyTuple_New(N) * for i in range(N): */ if (likely(PyList_CheckExact(__pyx_v_seq)) || PyTuple_CheckExact(__pyx_v_seq)) { __pyx_t_1 = __pyx_v_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 153, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 153, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 153, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_6); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_6); __pyx_t_6 = 0; /* "cytoolz/itertoolz.pyx":154 * N = PyList_GET_SIZE(key) * for item in seq: * keyval = PyTuple_New(N) # <<<<<<<<<<<<<< * for i in range(N): * val = PyList_GET_ITEM(key, i) */ __pyx_t_6 = PyTuple_New(__pyx_v_N); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_keyval, __pyx_t_6); __pyx_t_6 = 0; /* "cytoolz/itertoolz.pyx":155 * for item in seq: * keyval = PyTuple_New(N) * for i in range(N): # <<<<<<<<<<<<<< * val = PyList_GET_ITEM(key, i) * val = item[val] */ __pyx_t_9 = __pyx_v_N; __pyx_t_10 = __pyx_t_9; for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; /* "cytoolz/itertoolz.pyx":156 * keyval = PyTuple_New(N) * for i in range(N): * val = PyList_GET_ITEM(key, i) # <<<<<<<<<<<<<< * val = item[val] * Py_INCREF(val) */ __pyx_t_12 = PyList_GET_ITEM(__pyx_v_key, __pyx_v_i); __pyx_t_6 = ((PyObject *)__pyx_t_12); __Pyx_INCREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6); __pyx_t_6 = 0; /* "cytoolz/itertoolz.pyx":157 * for i in range(N): * val = PyList_GET_ITEM(key, i) * val = item[val] # <<<<<<<<<<<<<< * Py_INCREF(val) * PyTuple_SET_ITEM(keyval, i, val) */ __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_item, __pyx_v_val); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_6); __pyx_t_6 = 0; /* "cytoolz/itertoolz.pyx":158 * val = PyList_GET_ITEM(key, i) * val = item[val] * Py_INCREF(val) # <<<<<<<<<<<<<< * PyTuple_SET_ITEM(keyval, i, val) * _groupby_core(d, keyval, item) */ Py_INCREF(__pyx_v_val); /* "cytoolz/itertoolz.pyx":159 * val = item[val] * Py_INCREF(val) * PyTuple_SET_ITEM(keyval, i, val) # <<<<<<<<<<<<<< * _groupby_core(d, keyval, item) * else: */ PyTuple_SET_ITEM(__pyx_v_keyval, __pyx_v_i, __pyx_v_val); } /* "cytoolz/itertoolz.pyx":160 * Py_INCREF(val) * PyTuple_SET_ITEM(keyval, i, val) * _groupby_core(d, keyval, item) # <<<<<<<<<<<<<< * else: * for item in seq: */ __pyx_t_6 = __pyx_f_7cytoolz_9itertoolz__groupby_core(__pyx_v_d, __pyx_v_keyval, __pyx_v_item); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "cytoolz/itertoolz.pyx":153 * elif isinstance(key, list): * N = PyList_GET_SIZE(key) * for item in seq: # <<<<<<<<<<<<<< * keyval = PyTuple_New(N) * for i in range(N): */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":151 * keyval = key(item) * _groupby_core(d, keyval, item) * elif isinstance(key, list): # <<<<<<<<<<<<<< * N = PyList_GET_SIZE(key) * for item in seq: */ goto __pyx_L3; } /* "cytoolz/itertoolz.pyx":162 * _groupby_core(d, keyval, item) * else: * for item in seq: # <<<<<<<<<<<<<< * keyval = item[key] * _groupby_core(d, keyval, item) */ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_seq)) || PyTuple_CheckExact(__pyx_v_seq)) { __pyx_t_1 = __pyx_v_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 162, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 162, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 162, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 162, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_6); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_6); __pyx_t_6 = 0; /* "cytoolz/itertoolz.pyx":163 * else: * for item in seq: * keyval = item[key] # <<<<<<<<<<<<<< * _groupby_core(d, keyval, item) * return d */ __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_item, __pyx_v_key); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_keyval, __pyx_t_6); __pyx_t_6 = 0; /* "cytoolz/itertoolz.pyx":164 * for item in seq: * keyval = item[key] * _groupby_core(d, keyval, item) # <<<<<<<<<<<<<< * return d * */ __pyx_t_6 = __pyx_f_7cytoolz_9itertoolz__groupby_core(__pyx_v_d, __pyx_v_keyval, __pyx_v_item); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; /* "cytoolz/itertoolz.pyx":162 * _groupby_core(d, keyval, item) * else: * for item in seq: # <<<<<<<<<<<<<< * keyval = item[key] * _groupby_core(d, keyval, item) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_L3:; /* "cytoolz/itertoolz.pyx":165 * keyval = item[key] * _groupby_core(d, keyval, item) * return d # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_d); __pyx_r = __pyx_v_d; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":118 * * * cpdef dict groupby(object key, object seq): # <<<<<<<<<<<<<< * """ * Group a collection by a key function */ /* 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_AddTraceback("cytoolz.itertoolz.groupby", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_d); __Pyx_XDECREF(__pyx_v_item); __Pyx_XDECREF(__pyx_v_keyval); __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_3groupby(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_2groupby[] = "groupby(key, seq) -> dict\n\n Group a collection by a key function\n\n >>> names = ['Alice', 'Bob', 'Charlie', 'Dan', 'Edith', 'Frank']\n >>> groupby(len, names) # doctest: +SKIP\n {3: ['Bob', 'Dan'], 5: ['Alice', 'Edith', 'Frank'], 7: ['Charlie']}\n\n >>> iseven = lambda x: x % 2 == 0\n >>> groupby(iseven, [1, 2, 3, 4, 5, 6, 7, 8]) # doctest: +SKIP\n {False: [1, 3, 5, 7], True: [2, 4, 6, 8]}\n\n Non-callable keys imply grouping on a member.\n\n >>> groupby('gender', [{'name': 'Alice', 'gender': 'F'},\n ... {'name': 'Bob', 'gender': 'M'},\n ... {'name': 'Charlie', 'gender': 'M'}]) # doctest:+SKIP\n {'F': [{'gender': 'F', 'name': 'Alice'}],\n 'M': [{'gender': 'M', 'name': 'Bob'},\n {'gender': 'M', 'name': 'Charlie'}]}\n\n Not to be confused with ``itertools.groupby``\n\n See Also:\n countby\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_3groupby = {"groupby", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9itertoolz_3groupby, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9itertoolz_2groupby}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_3groupby(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_seq = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("groupby (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_seq,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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("groupby", 1, 2, 2, 1); __PYX_ERR(0, 118, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "groupby") < 0)) __PYX_ERR(0, 118, __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_seq = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("groupby", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 118, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.groupby", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_2groupby(__pyx_self, __pyx_v_key, __pyx_v_seq); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_2groupby(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_seq) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("groupby", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_groupby(__pyx_v_key, __pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.groupby", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":168 * * * cdef object _merge_sorted_binary(object seqs): # <<<<<<<<<<<<<< * mid = len(seqs) // 2 * L1 = seqs[:mid] */ static PyObject *__pyx_f_7cytoolz_9itertoolz__merge_sorted_binary(PyObject *__pyx_v_seqs) { Py_ssize_t __pyx_v_mid; PyObject *__pyx_v_L1 = NULL; PyObject *__pyx_v_seq1 = NULL; PyObject *__pyx_v_L2 = NULL; PyObject *__pyx_v_seq2 = NULL; PyObject *__pyx_v_val2 = NULL; 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; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; __Pyx_RefNannySetupContext("_merge_sorted_binary", 0); /* "cytoolz/itertoolz.pyx":169 * * cdef object _merge_sorted_binary(object seqs): * mid = len(seqs) // 2 # <<<<<<<<<<<<<< * L1 = seqs[:mid] * if len(L1) == 1: */ __pyx_t_1 = PyObject_Length(__pyx_v_seqs); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 169, __pyx_L1_error) __pyx_v_mid = __Pyx_div_Py_ssize_t(__pyx_t_1, 2); /* "cytoolz/itertoolz.pyx":170 * cdef object _merge_sorted_binary(object seqs): * mid = len(seqs) // 2 * L1 = seqs[:mid] # <<<<<<<<<<<<<< * if len(L1) == 1: * seq1 = iter(L1[0]) */ __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_seqs, 0, __pyx_v_mid, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_L1 = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":171 * mid = len(seqs) // 2 * L1 = seqs[:mid] * if len(L1) == 1: # <<<<<<<<<<<<<< * seq1 = iter(L1[0]) * else: */ __pyx_t_1 = PyObject_Length(__pyx_v_L1); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 171, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_1 == 1) != 0); if (__pyx_t_3) { /* "cytoolz/itertoolz.pyx":172 * L1 = seqs[:mid] * if len(L1) == 1: * seq1 = iter(L1[0]) # <<<<<<<<<<<<<< * else: * seq1 = _merge_sorted_binary(L1) */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_L1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_seq1 = __pyx_t_4; __pyx_t_4 = 0; /* "cytoolz/itertoolz.pyx":171 * mid = len(seqs) // 2 * L1 = seqs[:mid] * if len(L1) == 1: # <<<<<<<<<<<<<< * seq1 = iter(L1[0]) * else: */ goto __pyx_L3; } /* "cytoolz/itertoolz.pyx":174 * seq1 = iter(L1[0]) * else: * seq1 = _merge_sorted_binary(L1) # <<<<<<<<<<<<<< * L2 = seqs[mid:] * if len(L2) == 1: */ /*else*/ { __pyx_t_4 = __pyx_f_7cytoolz_9itertoolz__merge_sorted_binary(__pyx_v_L1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_seq1 = __pyx_t_4; __pyx_t_4 = 0; } __pyx_L3:; /* "cytoolz/itertoolz.pyx":175 * else: * seq1 = _merge_sorted_binary(L1) * L2 = seqs[mid:] # <<<<<<<<<<<<<< * if len(L2) == 1: * seq2 = iter(L2[0]) */ __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_seqs, __pyx_v_mid, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_L2 = __pyx_t_4; __pyx_t_4 = 0; /* "cytoolz/itertoolz.pyx":176 * seq1 = _merge_sorted_binary(L1) * L2 = seqs[mid:] * if len(L2) == 1: # <<<<<<<<<<<<<< * seq2 = iter(L2[0]) * else: */ __pyx_t_1 = PyObject_Length(__pyx_v_L2); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 176, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_1 == 1) != 0); if (__pyx_t_3) { /* "cytoolz/itertoolz.pyx":177 * L2 = seqs[mid:] * if len(L2) == 1: * seq2 = iter(L2[0]) # <<<<<<<<<<<<<< * else: * seq2 = _merge_sorted_binary(L2) */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_L2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_seq2 = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":176 * seq1 = _merge_sorted_binary(L1) * L2 = seqs[mid:] * if len(L2) == 1: # <<<<<<<<<<<<<< * seq2 = iter(L2[0]) * else: */ goto __pyx_L4; } /* "cytoolz/itertoolz.pyx":179 * seq2 = iter(L2[0]) * else: * seq2 = _merge_sorted_binary(L2) # <<<<<<<<<<<<<< * try: * val2 = next(seq2) */ /*else*/ { __pyx_t_2 = __pyx_f_7cytoolz_9itertoolz__merge_sorted_binary(__pyx_v_L2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_seq2 = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L4:; /* "cytoolz/itertoolz.pyx":180 * else: * seq2 = _merge_sorted_binary(L2) * try: # <<<<<<<<<<<<<< * val2 = next(seq2) * except StopIteration: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __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:*/ { /* "cytoolz/itertoolz.pyx":181 * seq2 = _merge_sorted_binary(L2) * try: * val2 = next(seq2) # <<<<<<<<<<<<<< * except StopIteration: * return seq1 */ __pyx_t_2 = __Pyx_PyIter_Next(__pyx_v_seq2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_val2 = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":180 * else: * seq2 = _merge_sorted_binary(L2) * try: # <<<<<<<<<<<<<< * val2 = next(seq2) * except StopIteration: */ } __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_L10_try_end; __pyx_L5_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/itertoolz.pyx":182 * try: * val2 = next(seq2) * except StopIteration: # <<<<<<<<<<<<<< * return seq1 * return _merge_sorted(seq1, seq2, val2) */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_8) { __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_9) < 0) __PYX_ERR(0, 182, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_9); /* "cytoolz/itertoolz.pyx":183 * val2 = next(seq2) * except StopIteration: * return seq1 # <<<<<<<<<<<<<< * return _merge_sorted(seq1, seq2, val2) * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_seq1); __pyx_r = __pyx_v_seq1; __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_L8_except_return; } goto __pyx_L7_except_error; __pyx_L7_except_error:; /* "cytoolz/itertoolz.pyx":180 * else: * seq2 = _merge_sorted_binary(L2) * try: # <<<<<<<<<<<<<< * val2 = next(seq2) * except StopIteration: */ __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_L10_try_end:; } /* "cytoolz/itertoolz.pyx":184 * except StopIteration: * return seq1 * return _merge_sorted(seq1, seq2, val2) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_seq1); __Pyx_GIVEREF(__pyx_v_seq1); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_seq1); __Pyx_INCREF(__pyx_v_seq2); __Pyx_GIVEREF(__pyx_v_seq2); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_seq2); __Pyx_INCREF(__pyx_v_val2); __Pyx_GIVEREF(__pyx_v_val2); PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_val2); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__merge_sorted), __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __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; /* "cytoolz/itertoolz.pyx":168 * * * cdef object _merge_sorted_binary(object seqs): # <<<<<<<<<<<<<< * mid = len(seqs) // 2 * L1 = seqs[:mid] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted_binary", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_L1); __Pyx_XDECREF(__pyx_v_seq1); __Pyx_XDECREF(__pyx_v_L2); __Pyx_XDECREF(__pyx_v_seq2); __Pyx_XDECREF(__pyx_v_val2); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":188 * * cdef class _merge_sorted: * def __cinit__(self, seq1, seq2, val2): # <<<<<<<<<<<<<< * self.seq1 = seq1 * self.seq2 = seq2 */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_seq1 = 0; PyObject *__pyx_v_seq2 = 0; PyObject *__pyx_v_val2 = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seq1,&__pyx_n_s_seq2,&__pyx_n_s_val2,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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq1)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); __PYX_ERR(0, 188, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_val2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); __PYX_ERR(0, 188, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 188, __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_seq1 = values[0]; __pyx_v_seq2 = values[1]; __pyx_v_val2 = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 188, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13_merge_sorted___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *)__pyx_v_self), __pyx_v_seq1, __pyx_v_seq2, __pyx_v_val2); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9itertoolz_13_merge_sorted___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *__pyx_v_self, PyObject *__pyx_v_seq1, PyObject *__pyx_v_seq2, PyObject *__pyx_v_val2) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/itertoolz.pyx":189 * cdef class _merge_sorted: * def __cinit__(self, seq1, seq2, val2): * self.seq1 = seq1 # <<<<<<<<<<<<<< * self.seq2 = seq2 * self.val1 = None */ __Pyx_INCREF(__pyx_v_seq1); __Pyx_GIVEREF(__pyx_v_seq1); __Pyx_GOTREF(__pyx_v_self->seq1); __Pyx_DECREF(__pyx_v_self->seq1); __pyx_v_self->seq1 = __pyx_v_seq1; /* "cytoolz/itertoolz.pyx":190 * def __cinit__(self, seq1, seq2, val2): * self.seq1 = seq1 * self.seq2 = seq2 # <<<<<<<<<<<<<< * self.val1 = None * self.val2 = val2 */ __Pyx_INCREF(__pyx_v_seq2); __Pyx_GIVEREF(__pyx_v_seq2); __Pyx_GOTREF(__pyx_v_self->seq2); __Pyx_DECREF(__pyx_v_self->seq2); __pyx_v_self->seq2 = __pyx_v_seq2; /* "cytoolz/itertoolz.pyx":191 * self.seq1 = seq1 * self.seq2 = seq2 * self.val1 = None # <<<<<<<<<<<<<< * self.val2 = val2 * self.loop = 0 */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->val1); __Pyx_DECREF(__pyx_v_self->val1); __pyx_v_self->val1 = Py_None; /* "cytoolz/itertoolz.pyx":192 * self.seq2 = seq2 * self.val1 = None * self.val2 = val2 # <<<<<<<<<<<<<< * self.loop = 0 * */ __Pyx_INCREF(__pyx_v_val2); __Pyx_GIVEREF(__pyx_v_val2); __Pyx_GOTREF(__pyx_v_self->val2); __Pyx_DECREF(__pyx_v_self->val2); __pyx_v_self->val2 = __pyx_v_val2; /* "cytoolz/itertoolz.pyx":193 * self.val1 = None * self.val2 = val2 * self.loop = 0 # <<<<<<<<<<<<<< * * def __iter__(self): */ __pyx_v_self->loop = 0; /* "cytoolz/itertoolz.pyx":188 * * cdef class _merge_sorted: * def __cinit__(self, seq1, seq2, val2): # <<<<<<<<<<<<<< * self.seq1 = seq1 * self.seq2 = seq2 */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":195 * self.loop = 0 * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13_merge_sorted_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_13_merge_sorted_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* "cytoolz/itertoolz.pyx":196 * * 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; /* "cytoolz/itertoolz.pyx":195 * self.loop = 0 * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":198 * return self * * def __next__(self): # <<<<<<<<<<<<<< * if self.loop == 0: * try: */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_5__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13_merge_sorted_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_13_merge_sorted_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *__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; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":199 * * def __next__(self): * if self.loop == 0: # <<<<<<<<<<<<<< * try: * self.val1 = next(self.seq1) */ switch (__pyx_v_self->loop) { case 0: /* "cytoolz/itertoolz.pyx":200 * def __next__(self): * if self.loop == 0: * try: # <<<<<<<<<<<<<< * self.val1 = next(self.seq1) * except StopIteration: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __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:*/ { /* "cytoolz/itertoolz.pyx":201 * if self.loop == 0: * try: * self.val1 = next(self.seq1) # <<<<<<<<<<<<<< * except StopIteration: * self.loop = 2 */ __pyx_t_4 = __pyx_v_self->seq1; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyIter_Next(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->val1); __Pyx_DECREF(__pyx_v_self->val1); __pyx_v_self->val1 = __pyx_t_5; __pyx_t_5 = 0; /* "cytoolz/itertoolz.pyx":200 * def __next__(self): * if self.loop == 0: * try: # <<<<<<<<<<<<<< * self.val1 = next(self.seq1) * except StopIteration: */ } __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_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "cytoolz/itertoolz.pyx":202 * try: * self.val1 = next(self.seq1) * except StopIteration: # <<<<<<<<<<<<<< * self.loop = 2 * return self.val2 */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_6) { __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 202, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_7); /* "cytoolz/itertoolz.pyx":203 * self.val1 = next(self.seq1) * except StopIteration: * self.loop = 2 # <<<<<<<<<<<<<< * return self.val2 * if self.val2 < self.val1: */ __pyx_v_self->loop = 2; /* "cytoolz/itertoolz.pyx":204 * except StopIteration: * self.loop = 2 * return self.val2 # <<<<<<<<<<<<<< * if self.val2 < self.val1: * self.loop = 1 */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->val2); __pyx_r = __pyx_v_self->val2; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "cytoolz/itertoolz.pyx":200 * def __next__(self): * if self.loop == 0: * try: # <<<<<<<<<<<<<< * self.val1 = next(self.seq1) * except StopIteration: */ __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_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_L8_try_end:; } /* "cytoolz/itertoolz.pyx":205 * self.loop = 2 * return self.val2 * if self.val2 < self.val1: # <<<<<<<<<<<<<< * self.loop = 1 * return self.val2 */ __pyx_t_7 = PyObject_RichCompare(__pyx_v_self->val2, __pyx_v_self->val1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 205, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_8) { /* "cytoolz/itertoolz.pyx":206 * return self.val2 * if self.val2 < self.val1: * self.loop = 1 # <<<<<<<<<<<<<< * return self.val2 * return self.val1 */ __pyx_v_self->loop = 1; /* "cytoolz/itertoolz.pyx":207 * if self.val2 < self.val1: * self.loop = 1 * return self.val2 # <<<<<<<<<<<<<< * return self.val1 * elif self.loop == 1: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->val2); __pyx_r = __pyx_v_self->val2; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":205 * self.loop = 2 * return self.val2 * if self.val2 < self.val1: # <<<<<<<<<<<<<< * self.loop = 1 * return self.val2 */ } /* "cytoolz/itertoolz.pyx":208 * self.loop = 1 * return self.val2 * return self.val1 # <<<<<<<<<<<<<< * elif self.loop == 1: * try: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->val1); __pyx_r = __pyx_v_self->val1; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":199 * * def __next__(self): * if self.loop == 0: # <<<<<<<<<<<<<< * try: * self.val1 = next(self.seq1) */ break; case 1: /* "cytoolz/itertoolz.pyx":210 * return self.val1 * elif self.loop == 1: * try: # <<<<<<<<<<<<<< * self.val2 = next(self.seq2) * except StopIteration: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_1); /*try:*/ { /* "cytoolz/itertoolz.pyx":211 * elif self.loop == 1: * try: * self.val2 = next(self.seq2) # <<<<<<<<<<<<<< * except StopIteration: * self.loop = 3 */ __pyx_t_7 = __pyx_v_self->seq2; __Pyx_INCREF(__pyx_t_7); __pyx_t_4 = __Pyx_PyIter_Next(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->val2); __Pyx_DECREF(__pyx_v_self->val2); __pyx_v_self->val2 = __pyx_t_4; __pyx_t_4 = 0; /* "cytoolz/itertoolz.pyx":210 * return self.val1 * elif self.loop == 1: * try: # <<<<<<<<<<<<<< * self.val2 = next(self.seq2) * except StopIteration: */ } __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; goto __pyx_L17_try_end; __pyx_L12_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "cytoolz/itertoolz.pyx":212 * try: * self.val2 = next(self.seq2) * except StopIteration: # <<<<<<<<<<<<<< * self.loop = 3 * return self.val1 */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_6) { __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_5) < 0) __PYX_ERR(0, 212, __pyx_L14_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_5); /* "cytoolz/itertoolz.pyx":213 * self.val2 = next(self.seq2) * except StopIteration: * self.loop = 3 # <<<<<<<<<<<<<< * return self.val1 * if self.val2 < self.val1: */ __pyx_v_self->loop = 3; /* "cytoolz/itertoolz.pyx":214 * except StopIteration: * self.loop = 3 * return self.val1 # <<<<<<<<<<<<<< * if self.val2 < self.val1: * return self.val2 */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->val1); __pyx_r = __pyx_v_self->val1; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L15_except_return; } goto __pyx_L14_except_error; __pyx_L14_except_error:; /* "cytoolz/itertoolz.pyx":210 * return self.val1 * elif self.loop == 1: * try: # <<<<<<<<<<<<<< * self.val2 = next(self.seq2) * except StopIteration: */ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1); goto __pyx_L1_error; __pyx_L15_except_return:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1); goto __pyx_L0; __pyx_L17_try_end:; } /* "cytoolz/itertoolz.pyx":215 * self.loop = 3 * return self.val1 * if self.val2 < self.val1: # <<<<<<<<<<<<<< * return self.val2 * self.loop = 0 */ __pyx_t_5 = PyObject_RichCompare(__pyx_v_self->val2, __pyx_v_self->val1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_8) { /* "cytoolz/itertoolz.pyx":216 * return self.val1 * if self.val2 < self.val1: * return self.val2 # <<<<<<<<<<<<<< * self.loop = 0 * return self.val1 */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->val2); __pyx_r = __pyx_v_self->val2; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":215 * self.loop = 3 * return self.val1 * if self.val2 < self.val1: # <<<<<<<<<<<<<< * return self.val2 * self.loop = 0 */ } /* "cytoolz/itertoolz.pyx":217 * if self.val2 < self.val1: * return self.val2 * self.loop = 0 # <<<<<<<<<<<<<< * return self.val1 * elif self.loop == 2: */ __pyx_v_self->loop = 0; /* "cytoolz/itertoolz.pyx":218 * return self.val2 * self.loop = 0 * return self.val1 # <<<<<<<<<<<<<< * elif self.loop == 2: * return next(self.seq2) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->val1); __pyx_r = __pyx_v_self->val1; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":209 * return self.val2 * return self.val1 * elif self.loop == 1: # <<<<<<<<<<<<<< * try: * self.val2 = next(self.seq2) */ break; case 2: /* "cytoolz/itertoolz.pyx":220 * return self.val1 * elif self.loop == 2: * return next(self.seq2) # <<<<<<<<<<<<<< * return next(self.seq1) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __pyx_v_self->seq2; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyIter_Next(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 220, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":219 * self.loop = 0 * return self.val1 * elif self.loop == 2: # <<<<<<<<<<<<<< * return next(self.seq2) * return next(self.seq1) */ break; default: break; } /* "cytoolz/itertoolz.pyx":221 * elif self.loop == 2: * return next(self.seq2) * return next(self.seq1) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __pyx_v_self->seq1; __Pyx_INCREF(__pyx_t_7); __pyx_t_5 = __Pyx_PyIter_Next(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 221, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":198 * return self * * def __next__(self): # <<<<<<<<<<<<<< * if self.loop == 0: * try: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_13_merge_sorted_6__reduce_cython__[] = "_merge_sorted.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_13_merge_sorted_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_13_merge_sorted_6__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13_merge_sorted_6__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_13_merge_sorted_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_13_merge_sorted_8__setstate_cython__[] = "_merge_sorted.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_13_merge_sorted_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_13_merge_sorted_8__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13_merge_sorted_8__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_13_merge_sorted_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":224 * * * cdef object _merge_sorted_binary_key(object seqs, object key): # <<<<<<<<<<<<<< * mid = len(seqs) // 2 * L1 = seqs[:mid] */ static PyObject *__pyx_f_7cytoolz_9itertoolz__merge_sorted_binary_key(PyObject *__pyx_v_seqs, PyObject *__pyx_v_key) { Py_ssize_t __pyx_v_mid; PyObject *__pyx_v_L1 = NULL; PyObject *__pyx_v_seq1 = NULL; PyObject *__pyx_v_L2 = NULL; PyObject *__pyx_v_seq2 = NULL; PyObject *__pyx_v_val2 = NULL; 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; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; __Pyx_RefNannySetupContext("_merge_sorted_binary_key", 0); /* "cytoolz/itertoolz.pyx":225 * * cdef object _merge_sorted_binary_key(object seqs, object key): * mid = len(seqs) // 2 # <<<<<<<<<<<<<< * L1 = seqs[:mid] * if len(L1) == 1: */ __pyx_t_1 = PyObject_Length(__pyx_v_seqs); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 225, __pyx_L1_error) __pyx_v_mid = __Pyx_div_Py_ssize_t(__pyx_t_1, 2); /* "cytoolz/itertoolz.pyx":226 * cdef object _merge_sorted_binary_key(object seqs, object key): * mid = len(seqs) // 2 * L1 = seqs[:mid] # <<<<<<<<<<<<<< * if len(L1) == 1: * seq1 = iter(L1[0]) */ __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_seqs, 0, __pyx_v_mid, NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_L1 = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":227 * mid = len(seqs) // 2 * L1 = seqs[:mid] * if len(L1) == 1: # <<<<<<<<<<<<<< * seq1 = iter(L1[0]) * else: */ __pyx_t_1 = PyObject_Length(__pyx_v_L1); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 227, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_1 == 1) != 0); if (__pyx_t_3) { /* "cytoolz/itertoolz.pyx":228 * L1 = seqs[:mid] * if len(L1) == 1: * seq1 = iter(L1[0]) # <<<<<<<<<<<<<< * else: * seq1 = _merge_sorted_binary_key(L1, key) */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_L1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_seq1 = __pyx_t_4; __pyx_t_4 = 0; /* "cytoolz/itertoolz.pyx":227 * mid = len(seqs) // 2 * L1 = seqs[:mid] * if len(L1) == 1: # <<<<<<<<<<<<<< * seq1 = iter(L1[0]) * else: */ goto __pyx_L3; } /* "cytoolz/itertoolz.pyx":230 * seq1 = iter(L1[0]) * else: * seq1 = _merge_sorted_binary_key(L1, key) # <<<<<<<<<<<<<< * L2 = seqs[mid:] * if len(L2) == 1: */ /*else*/ { __pyx_t_4 = __pyx_f_7cytoolz_9itertoolz__merge_sorted_binary_key(__pyx_v_L1, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_seq1 = __pyx_t_4; __pyx_t_4 = 0; } __pyx_L3:; /* "cytoolz/itertoolz.pyx":231 * else: * seq1 = _merge_sorted_binary_key(L1, key) * L2 = seqs[mid:] # <<<<<<<<<<<<<< * if len(L2) == 1: * seq2 = iter(L2[0]) */ __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_seqs, __pyx_v_mid, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_L2 = __pyx_t_4; __pyx_t_4 = 0; /* "cytoolz/itertoolz.pyx":232 * seq1 = _merge_sorted_binary_key(L1, key) * L2 = seqs[mid:] * if len(L2) == 1: # <<<<<<<<<<<<<< * seq2 = iter(L2[0]) * else: */ __pyx_t_1 = PyObject_Length(__pyx_v_L2); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 232, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_1 == 1) != 0); if (__pyx_t_3) { /* "cytoolz/itertoolz.pyx":233 * L2 = seqs[mid:] * if len(L2) == 1: * seq2 = iter(L2[0]) # <<<<<<<<<<<<<< * else: * seq2 = _merge_sorted_binary_key(L2, key) */ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_L2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_seq2 = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":232 * seq1 = _merge_sorted_binary_key(L1, key) * L2 = seqs[mid:] * if len(L2) == 1: # <<<<<<<<<<<<<< * seq2 = iter(L2[0]) * else: */ goto __pyx_L4; } /* "cytoolz/itertoolz.pyx":235 * seq2 = iter(L2[0]) * else: * seq2 = _merge_sorted_binary_key(L2, key) # <<<<<<<<<<<<<< * try: * val2 = next(seq2) */ /*else*/ { __pyx_t_2 = __pyx_f_7cytoolz_9itertoolz__merge_sorted_binary_key(__pyx_v_L2, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_seq2 = __pyx_t_2; __pyx_t_2 = 0; } __pyx_L4:; /* "cytoolz/itertoolz.pyx":236 * else: * seq2 = _merge_sorted_binary_key(L2, key) * try: # <<<<<<<<<<<<<< * val2 = next(seq2) * except StopIteration: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __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:*/ { /* "cytoolz/itertoolz.pyx":237 * seq2 = _merge_sorted_binary_key(L2, key) * try: * val2 = next(seq2) # <<<<<<<<<<<<<< * except StopIteration: * return seq1 */ __pyx_t_2 = __Pyx_PyIter_Next(__pyx_v_seq2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_val2 = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":236 * else: * seq2 = _merge_sorted_binary_key(L2, key) * try: # <<<<<<<<<<<<<< * val2 = next(seq2) * except StopIteration: */ } __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_L10_try_end; __pyx_L5_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/itertoolz.pyx":238 * try: * val2 = next(seq2) * except StopIteration: # <<<<<<<<<<<<<< * return seq1 * return _merge_sorted_key(seq1, seq2, val2, key) */ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_8) { __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted_binary_key", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_4, &__pyx_t_9) < 0) __PYX_ERR(0, 238, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_9); /* "cytoolz/itertoolz.pyx":239 * val2 = next(seq2) * except StopIteration: * return seq1 # <<<<<<<<<<<<<< * return _merge_sorted_key(seq1, seq2, val2, key) * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_seq1); __pyx_r = __pyx_v_seq1; __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_L8_except_return; } goto __pyx_L7_except_error; __pyx_L7_except_error:; /* "cytoolz/itertoolz.pyx":236 * else: * seq2 = _merge_sorted_binary_key(L2, key) * try: # <<<<<<<<<<<<<< * val2 = next(seq2) * except StopIteration: */ __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_L10_try_end:; } /* "cytoolz/itertoolz.pyx":240 * except StopIteration: * return seq1 * return _merge_sorted_key(seq1, seq2, val2, key) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_seq1); __Pyx_GIVEREF(__pyx_v_seq1); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_seq1); __Pyx_INCREF(__pyx_v_seq2); __Pyx_GIVEREF(__pyx_v_seq2); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_seq2); __Pyx_INCREF(__pyx_v_val2); __Pyx_GIVEREF(__pyx_v_val2); PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_val2); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_v_key); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__merge_sorted_key), __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __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; /* "cytoolz/itertoolz.pyx":224 * * * cdef object _merge_sorted_binary_key(object seqs, object key): # <<<<<<<<<<<<<< * mid = len(seqs) // 2 * L1 = seqs[:mid] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted_binary_key", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_L1); __Pyx_XDECREF(__pyx_v_seq1); __Pyx_XDECREF(__pyx_v_L2); __Pyx_XDECREF(__pyx_v_seq2); __Pyx_XDECREF(__pyx_v_val2); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":244 * * cdef class _merge_sorted_key: * def __cinit__(self, seq1, seq2, val2, key): # <<<<<<<<<<<<<< * self.seq1 = seq1 * self.seq2 = seq2 */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_seq1 = 0; PyObject *__pyx_v_seq2 = 0; PyObject *__pyx_v_val2 = 0; PyObject *__pyx_v_key = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seq1,&__pyx_n_s_seq2,&__pyx_n_s_val2,&__pyx_n_s_key,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); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq1)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 1); __PYX_ERR(0, 244, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_val2)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 2); __PYX_ERR(0, 244, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, 3); __PYX_ERR(0, 244, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 244, __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_seq1 = values[0]; __pyx_v_seq2 = values[1]; __pyx_v_val2 = values[2]; __pyx_v_key = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 244, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted_key.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *)__pyx_v_self), __pyx_v_seq1, __pyx_v_seq2, __pyx_v_val2, __pyx_v_key); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *__pyx_v_self, PyObject *__pyx_v_seq1, PyObject *__pyx_v_seq2, PyObject *__pyx_v_val2, PyObject *__pyx_v_key) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/itertoolz.pyx":245 * cdef class _merge_sorted_key: * def __cinit__(self, seq1, seq2, val2, key): * self.seq1 = seq1 # <<<<<<<<<<<<<< * self.seq2 = seq2 * self.key = key */ __Pyx_INCREF(__pyx_v_seq1); __Pyx_GIVEREF(__pyx_v_seq1); __Pyx_GOTREF(__pyx_v_self->seq1); __Pyx_DECREF(__pyx_v_self->seq1); __pyx_v_self->seq1 = __pyx_v_seq1; /* "cytoolz/itertoolz.pyx":246 * def __cinit__(self, seq1, seq2, val2, key): * self.seq1 = seq1 * self.seq2 = seq2 # <<<<<<<<<<<<<< * self.key = key * self.val1 = None */ __Pyx_INCREF(__pyx_v_seq2); __Pyx_GIVEREF(__pyx_v_seq2); __Pyx_GOTREF(__pyx_v_self->seq2); __Pyx_DECREF(__pyx_v_self->seq2); __pyx_v_self->seq2 = __pyx_v_seq2; /* "cytoolz/itertoolz.pyx":247 * self.seq1 = seq1 * self.seq2 = seq2 * self.key = key # <<<<<<<<<<<<<< * self.val1 = None * self.key1 = None */ __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); __Pyx_GOTREF(__pyx_v_self->key); __Pyx_DECREF(__pyx_v_self->key); __pyx_v_self->key = __pyx_v_key; /* "cytoolz/itertoolz.pyx":248 * self.seq2 = seq2 * self.key = key * self.val1 = None # <<<<<<<<<<<<<< * self.key1 = None * self.val2 = val2 */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->val1); __Pyx_DECREF(__pyx_v_self->val1); __pyx_v_self->val1 = Py_None; /* "cytoolz/itertoolz.pyx":249 * self.key = key * self.val1 = None * self.key1 = None # <<<<<<<<<<<<<< * self.val2 = val2 * self.key2 = key(val2) */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->key1); __Pyx_DECREF(__pyx_v_self->key1); __pyx_v_self->key1 = Py_None; /* "cytoolz/itertoolz.pyx":250 * self.val1 = None * self.key1 = None * self.val2 = val2 # <<<<<<<<<<<<<< * self.key2 = key(val2) * self.loop = 0 */ __Pyx_INCREF(__pyx_v_val2); __Pyx_GIVEREF(__pyx_v_val2); __Pyx_GOTREF(__pyx_v_self->val2); __Pyx_DECREF(__pyx_v_self->val2); __pyx_v_self->val2 = __pyx_v_val2; /* "cytoolz/itertoolz.pyx":251 * self.key1 = None * self.val2 = val2 * self.key2 = key(val2) # <<<<<<<<<<<<<< * self.loop = 0 * */ __Pyx_INCREF(__pyx_v_key); __pyx_t_2 = __pyx_v_key; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_val2) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_val2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __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->key2); __Pyx_DECREF(__pyx_v_self->key2); __pyx_v_self->key2 = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":252 * self.val2 = val2 * self.key2 = key(val2) * self.loop = 0 # <<<<<<<<<<<<<< * * def __iter__(self): */ __pyx_v_self->loop = 0; /* "cytoolz/itertoolz.pyx":244 * * cdef class _merge_sorted_key: * def __cinit__(self, seq1, seq2, val2, key): # <<<<<<<<<<<<<< * self.seq1 = seq1 * self.seq2 = seq2 */ /* 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("cytoolz.itertoolz._merge_sorted_key.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":254 * self.loop = 0 * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* "cytoolz/itertoolz.pyx":255 * * 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; /* "cytoolz/itertoolz.pyx":254 * self.loop = 0 * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":257 * return self * * def __next__(self): # <<<<<<<<<<<<<< * if self.loop == 0: * try: */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_5__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *__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; PyObject *__pyx_t_5 = NULL; int __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":258 * * def __next__(self): * if self.loop == 0: # <<<<<<<<<<<<<< * try: * self.val1 = next(self.seq1) */ switch (__pyx_v_self->loop) { case 0: /* "cytoolz/itertoolz.pyx":259 * def __next__(self): * if self.loop == 0: * try: # <<<<<<<<<<<<<< * self.val1 = next(self.seq1) * except StopIteration: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __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:*/ { /* "cytoolz/itertoolz.pyx":260 * if self.loop == 0: * try: * self.val1 = next(self.seq1) # <<<<<<<<<<<<<< * except StopIteration: * self.loop = 2 */ __pyx_t_4 = __pyx_v_self->seq1; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyIter_Next(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 260, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->val1); __Pyx_DECREF(__pyx_v_self->val1); __pyx_v_self->val1 = __pyx_t_5; __pyx_t_5 = 0; /* "cytoolz/itertoolz.pyx":259 * def __next__(self): * if self.loop == 0: * try: # <<<<<<<<<<<<<< * self.val1 = next(self.seq1) * except StopIteration: */ } __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_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "cytoolz/itertoolz.pyx":261 * try: * self.val1 = next(self.seq1) * except StopIteration: # <<<<<<<<<<<<<< * self.loop = 2 * return self.val2 */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_6) { __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted_key.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(0, 261, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_7); /* "cytoolz/itertoolz.pyx":262 * self.val1 = next(self.seq1) * except StopIteration: * self.loop = 2 # <<<<<<<<<<<<<< * return self.val2 * self.key1 = self.key(self.val1) */ __pyx_v_self->loop = 2; /* "cytoolz/itertoolz.pyx":263 * except StopIteration: * self.loop = 2 * return self.val2 # <<<<<<<<<<<<<< * self.key1 = self.key(self.val1) * if self.key2 < self.key1: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->val2); __pyx_r = __pyx_v_self->val2; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L6_except_return; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "cytoolz/itertoolz.pyx":259 * def __next__(self): * if self.loop == 0: * try: # <<<<<<<<<<<<<< * self.val1 = next(self.seq1) * except StopIteration: */ __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_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_L8_try_end:; } /* "cytoolz/itertoolz.pyx":264 * self.loop = 2 * return self.val2 * self.key1 = self.key(self.val1) # <<<<<<<<<<<<<< * if self.key2 < self.key1: * self.loop = 1 */ __Pyx_INCREF(__pyx_v_self->key); __pyx_t_4 = __pyx_v_self->key; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_self->val1) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self->val1); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_7); __Pyx_GOTREF(__pyx_v_self->key1); __Pyx_DECREF(__pyx_v_self->key1); __pyx_v_self->key1 = __pyx_t_7; __pyx_t_7 = 0; /* "cytoolz/itertoolz.pyx":265 * return self.val2 * self.key1 = self.key(self.val1) * if self.key2 < self.key1: # <<<<<<<<<<<<<< * self.loop = 1 * return self.val2 */ __pyx_t_7 = PyObject_RichCompare(__pyx_v_self->key2, __pyx_v_self->key1, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 265, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_8) { /* "cytoolz/itertoolz.pyx":266 * self.key1 = self.key(self.val1) * if self.key2 < self.key1: * self.loop = 1 # <<<<<<<<<<<<<< * return self.val2 * return self.val1 */ __pyx_v_self->loop = 1; /* "cytoolz/itertoolz.pyx":267 * if self.key2 < self.key1: * self.loop = 1 * return self.val2 # <<<<<<<<<<<<<< * return self.val1 * elif self.loop == 1: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->val2); __pyx_r = __pyx_v_self->val2; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":265 * return self.val2 * self.key1 = self.key(self.val1) * if self.key2 < self.key1: # <<<<<<<<<<<<<< * self.loop = 1 * return self.val2 */ } /* "cytoolz/itertoolz.pyx":268 * self.loop = 1 * return self.val2 * return self.val1 # <<<<<<<<<<<<<< * elif self.loop == 1: * try: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->val1); __pyx_r = __pyx_v_self->val1; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":258 * * def __next__(self): * if self.loop == 0: # <<<<<<<<<<<<<< * try: * self.val1 = next(self.seq1) */ break; case 1: /* "cytoolz/itertoolz.pyx":270 * return self.val1 * elif self.loop == 1: * try: # <<<<<<<<<<<<<< * self.val2 = next(self.seq2) * except StopIteration: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1); __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_1); /*try:*/ { /* "cytoolz/itertoolz.pyx":271 * elif self.loop == 1: * try: * self.val2 = next(self.seq2) # <<<<<<<<<<<<<< * except StopIteration: * self.loop = 3 */ __pyx_t_7 = __pyx_v_self->seq2; __Pyx_INCREF(__pyx_t_7); __pyx_t_4 = __Pyx_PyIter_Next(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->val2); __Pyx_DECREF(__pyx_v_self->val2); __pyx_v_self->val2 = __pyx_t_4; __pyx_t_4 = 0; /* "cytoolz/itertoolz.pyx":270 * return self.val1 * elif self.loop == 1: * try: # <<<<<<<<<<<<<< * self.val2 = next(self.seq2) * except StopIteration: */ } __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; goto __pyx_L17_try_end; __pyx_L12_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; /* "cytoolz/itertoolz.pyx":272 * try: * self.val2 = next(self.seq2) * except StopIteration: # <<<<<<<<<<<<<< * self.loop = 3 * return self.val1 */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_6) { __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted_key.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_5) < 0) __PYX_ERR(0, 272, __pyx_L14_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_7); __Pyx_GOTREF(__pyx_t_5); /* "cytoolz/itertoolz.pyx":273 * self.val2 = next(self.seq2) * except StopIteration: * self.loop = 3 # <<<<<<<<<<<<<< * return self.val1 * self.key2 = self.key(self.val2) */ __pyx_v_self->loop = 3; /* "cytoolz/itertoolz.pyx":274 * except StopIteration: * self.loop = 3 * return self.val1 # <<<<<<<<<<<<<< * self.key2 = self.key(self.val2) * if self.key2 < self.key1: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->val1); __pyx_r = __pyx_v_self->val1; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L15_except_return; } goto __pyx_L14_except_error; __pyx_L14_except_error:; /* "cytoolz/itertoolz.pyx":270 * return self.val1 * elif self.loop == 1: * try: # <<<<<<<<<<<<<< * self.val2 = next(self.seq2) * except StopIteration: */ __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1); goto __pyx_L1_error; __pyx_L15_except_return:; __Pyx_XGIVEREF(__pyx_t_3); __Pyx_XGIVEREF(__pyx_t_2); __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1); goto __pyx_L0; __pyx_L17_try_end:; } /* "cytoolz/itertoolz.pyx":275 * self.loop = 3 * return self.val1 * self.key2 = self.key(self.val2) # <<<<<<<<<<<<<< * if self.key2 < self.key1: * return self.val2 */ __Pyx_INCREF(__pyx_v_self->key); __pyx_t_7 = __pyx_v_self->key; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_v_self->val2) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_self->val2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->key2); __Pyx_DECREF(__pyx_v_self->key2); __pyx_v_self->key2 = __pyx_t_5; __pyx_t_5 = 0; /* "cytoolz/itertoolz.pyx":276 * return self.val1 * self.key2 = self.key(self.val2) * if self.key2 < self.key1: # <<<<<<<<<<<<<< * return self.val2 * self.loop = 0 */ __pyx_t_5 = PyObject_RichCompare(__pyx_v_self->key2, __pyx_v_self->key1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error) __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_8) { /* "cytoolz/itertoolz.pyx":277 * self.key2 = self.key(self.val2) * if self.key2 < self.key1: * return self.val2 # <<<<<<<<<<<<<< * self.loop = 0 * return self.val1 */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->val2); __pyx_r = __pyx_v_self->val2; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":276 * return self.val1 * self.key2 = self.key(self.val2) * if self.key2 < self.key1: # <<<<<<<<<<<<<< * return self.val2 * self.loop = 0 */ } /* "cytoolz/itertoolz.pyx":278 * if self.key2 < self.key1: * return self.val2 * self.loop = 0 # <<<<<<<<<<<<<< * return self.val1 * elif self.loop == 2: */ __pyx_v_self->loop = 0; /* "cytoolz/itertoolz.pyx":279 * return self.val2 * self.loop = 0 * return self.val1 # <<<<<<<<<<<<<< * elif self.loop == 2: * return next(self.seq2) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->val1); __pyx_r = __pyx_v_self->val1; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":269 * return self.val2 * return self.val1 * elif self.loop == 1: # <<<<<<<<<<<<<< * try: * self.val2 = next(self.seq2) */ break; case 2: /* "cytoolz/itertoolz.pyx":281 * return self.val1 * elif self.loop == 2: * return next(self.seq2) # <<<<<<<<<<<<<< * return next(self.seq1) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __pyx_v_self->seq2; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyIter_Next(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":280 * self.loop = 0 * return self.val1 * elif self.loop == 2: # <<<<<<<<<<<<<< * return next(self.seq2) * return next(self.seq1) */ break; default: break; } /* "cytoolz/itertoolz.pyx":282 * elif self.loop == 2: * return next(self.seq2) * return next(self.seq1) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_7 = __pyx_v_self->seq1; __Pyx_INCREF(__pyx_t_7); __pyx_t_5 = __Pyx_PyIter_Next(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":257 * return self * * def __next__(self): # <<<<<<<<<<<<<< * if self.loop == 0: * try: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted_key.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_17_merge_sorted_key_6__reduce_cython__[] = "_merge_sorted_key.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_17_merge_sorted_key_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_17_merge_sorted_key_6__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key_6__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted_key.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_17_merge_sorted_key_8__setstate_cython__[] = "_merge_sorted_key.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_17_merge_sorted_key_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_17_merge_sorted_key_8__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key_8__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_merge_sorted_key_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._merge_sorted_key.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":285 * * * cdef object c_merge_sorted(object seqs, object key=None): # <<<<<<<<<<<<<< * if len(seqs) == 0: * return iter([]) */ static PyObject *__pyx_f_7cytoolz_9itertoolz_c_merge_sorted(PyObject *__pyx_v_seqs, struct __pyx_opt_args_7cytoolz_9itertoolz_c_merge_sorted *__pyx_optional_args) { PyObject *__pyx_v_key = ((PyObject *)Py_None); 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; int __pyx_t_5; __Pyx_RefNannySetupContext("c_merge_sorted", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_key = __pyx_optional_args->key; } } /* "cytoolz/itertoolz.pyx":286 * * cdef object c_merge_sorted(object seqs, object key=None): * if len(seqs) == 0: # <<<<<<<<<<<<<< * return iter([]) * elif len(seqs) == 1: */ __pyx_t_1 = PyObject_Length(__pyx_v_seqs); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 286, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_1 == 0) != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":287 * cdef object c_merge_sorted(object seqs, object key=None): * if len(seqs) == 0: * return iter([]) # <<<<<<<<<<<<<< * elif len(seqs) == 1: * return iter(seqs[0]) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __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; /* "cytoolz/itertoolz.pyx":286 * * cdef object c_merge_sorted(object seqs, object key=None): * if len(seqs) == 0: # <<<<<<<<<<<<<< * return iter([]) * elif len(seqs) == 1: */ } /* "cytoolz/itertoolz.pyx":288 * if len(seqs) == 0: * return iter([]) * elif len(seqs) == 1: # <<<<<<<<<<<<<< * return iter(seqs[0]) * elif key is None: */ __pyx_t_1 = PyObject_Length(__pyx_v_seqs); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 288, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_1 == 1) != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":289 * return iter([]) * elif len(seqs) == 1: * return iter(seqs[0]) # <<<<<<<<<<<<<< * elif key is None: * return _merge_sorted_binary(seqs) */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_seqs, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __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; /* "cytoolz/itertoolz.pyx":288 * if len(seqs) == 0: * return iter([]) * elif len(seqs) == 1: # <<<<<<<<<<<<<< * return iter(seqs[0]) * elif key is None: */ } /* "cytoolz/itertoolz.pyx":290 * elif len(seqs) == 1: * return iter(seqs[0]) * elif key is None: # <<<<<<<<<<<<<< * return _merge_sorted_binary(seqs) * return _merge_sorted_binary_key(seqs, key) */ __pyx_t_2 = (__pyx_v_key == Py_None); __pyx_t_5 = (__pyx_t_2 != 0); if (__pyx_t_5) { /* "cytoolz/itertoolz.pyx":291 * return iter(seqs[0]) * elif key is None: * return _merge_sorted_binary(seqs) # <<<<<<<<<<<<<< * return _merge_sorted_binary_key(seqs, key) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_7cytoolz_9itertoolz__merge_sorted_binary(__pyx_v_seqs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":290 * elif len(seqs) == 1: * return iter(seqs[0]) * elif key is None: # <<<<<<<<<<<<<< * return _merge_sorted_binary(seqs) * return _merge_sorted_binary_key(seqs, key) */ } /* "cytoolz/itertoolz.pyx":292 * elif key is None: * return _merge_sorted_binary(seqs) * return _merge_sorted_binary_key(seqs, key) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_7cytoolz_9itertoolz__merge_sorted_binary_key(__pyx_v_seqs, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":285 * * * cdef object c_merge_sorted(object seqs, object key=None): # <<<<<<<<<<<<<< * if len(seqs) == 0: * return iter([]) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("cytoolz.itertoolz.c_merge_sorted", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":295 * * * def merge_sorted(*seqs, **kwargs): # <<<<<<<<<<<<<< * """ * Merge and sort a collection of sorted collections */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_5merge_sorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_4merge_sorted[] = "merge_sorted(*seqs, **kwargs)\n\n Merge and sort a collection of sorted collections\n\n This works lazily and only keeps one value from each iterable in memory.\n\n >>> list(merge_sorted([1, 3, 5], [2, 4, 6]))\n [1, 2, 3, 4, 5, 6]\n\n >>> ''.join(merge_sorted('abc', 'abc', 'abc'))\n 'aaabbbccc'\n\n The \"key\" function used to sort the input may be passed as a keyword.\n\n >>> list(merge_sorted([2, 3], [1, 3], key=lambda x: x // 3))\n [2, 1, 3, 3]\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_5merge_sorted = {"merge_sorted", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9itertoolz_5merge_sorted, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9itertoolz_4merge_sorted}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_5merge_sorted(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_seqs = 0; PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("merge_sorted (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "merge_sorted", 1))) return NULL; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_seqs = __pyx_args; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_4merge_sorted(__pyx_self, __pyx_v_seqs, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_seqs); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_4merge_sorted(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seqs, PyObject *__pyx_v_kwargs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; struct __pyx_opt_args_7cytoolz_9itertoolz_c_merge_sorted __pyx_t_5; __Pyx_RefNannySetupContext("merge_sorted", 0); /* "cytoolz/itertoolz.pyx":312 * [2, 1, 3, 3] * """ * if 'key' in kwargs: # <<<<<<<<<<<<<< * return c_merge_sorted(seqs, kwargs['key']) * return c_merge_sorted(seqs) */ __pyx_t_1 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_key, __pyx_v_kwargs, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 312, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":313 * """ * if 'key' in kwargs: * return c_merge_sorted(seqs, kwargs['key']) # <<<<<<<<<<<<<< * return c_merge_sorted(seqs) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_kwargs, __pyx_n_s_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5.__pyx_n = 1; __pyx_t_5.key = __pyx_t_3; __pyx_t_4 = __pyx_f_7cytoolz_9itertoolz_c_merge_sorted(__pyx_v_seqs, &__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __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; /* "cytoolz/itertoolz.pyx":312 * [2, 1, 3, 3] * """ * if 'key' in kwargs: # <<<<<<<<<<<<<< * return c_merge_sorted(seqs, kwargs['key']) * return c_merge_sorted(seqs) */ } /* "cytoolz/itertoolz.pyx":314 * if 'key' in kwargs: * return c_merge_sorted(seqs, kwargs['key']) * return c_merge_sorted(seqs) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __pyx_f_7cytoolz_9itertoolz_c_merge_sorted(__pyx_v_seqs, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":295 * * * def merge_sorted(*seqs, **kwargs): # <<<<<<<<<<<<<< * """ * Merge and sort a collection of sorted collections */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("cytoolz.itertoolz.merge_sorted", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":332 * Returns a lazy iterator * """ * def __cinit__(self, seqs): # <<<<<<<<<<<<<< * self.iters = [iter(seq) for seq in seqs] * self.newiters = [] */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9itertoolz_10interleave_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9itertoolz_10interleave_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_seqs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seqs,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); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seqs)) != 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, "__cinit__") < 0)) __PYX_ERR(0, 332, __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_seqs = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.interleave.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_10interleave___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz_interleave *)__pyx_v_self), __pyx_v_seqs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9itertoolz_10interleave___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_interleave *__pyx_v_self, PyObject *__pyx_v_seqs) { PyObject *__pyx_v_seq = NULL; int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/itertoolz.pyx":333 * """ * def __cinit__(self, seqs): * self.iters = [iter(seq) for seq in seqs] # <<<<<<<<<<<<<< * self.newiters = [] * self.i = 0 */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_v_seqs)) || PyTuple_CheckExact(__pyx_v_seqs)) { __pyx_t_2 = __pyx_v_seqs; __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_seqs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 333, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 333, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 333, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_seq, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->iters); __Pyx_DECREF(__pyx_v_self->iters); __pyx_v_self->iters = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":334 * def __cinit__(self, seqs): * self.iters = [iter(seq) for seq in seqs] * self.newiters = [] # <<<<<<<<<<<<<< * self.i = 0 * self.n = PyList_GET_SIZE(self.iters) */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->newiters); __Pyx_DECREF(__pyx_v_self->newiters); __pyx_v_self->newiters = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":335 * self.iters = [iter(seq) for seq in seqs] * self.newiters = [] * self.i = 0 # <<<<<<<<<<<<<< * self.n = PyList_GET_SIZE(self.iters) * */ __pyx_v_self->i = 0; /* "cytoolz/itertoolz.pyx":336 * self.newiters = [] * self.i = 0 * self.n = PyList_GET_SIZE(self.iters) # <<<<<<<<<<<<<< * * def __iter__(self): */ __pyx_t_1 = __pyx_v_self->iters; __Pyx_INCREF(__pyx_t_1); __pyx_v_self->n = PyList_GET_SIZE(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":332 * Returns a lazy iterator * """ * def __cinit__(self, seqs): # <<<<<<<<<<<<<< * self.iters = [iter(seq) for seq in seqs] * self.newiters = [] */ /* 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("cytoolz.itertoolz.interleave.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_seq); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":338 * self.n = PyList_GET_SIZE(self.iters) * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_10interleave_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_10interleave_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_10interleave_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz_interleave *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_10interleave_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_interleave *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* "cytoolz/itertoolz.pyx":339 * * 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; /* "cytoolz/itertoolz.pyx":338 * self.n = PyList_GET_SIZE(self.iters) * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":341 * return self * * def __next__(self): # <<<<<<<<<<<<<< * # This implementation is similar to what is done in `toolz` in that we * # construct a new list of iterators, `self.newiters`, when a value is */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_10interleave_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_10interleave_5__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_10interleave_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz_interleave *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_10interleave_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_interleave *__pyx_v_self) { PyObject *__pyx_v_obj; PyObject *__pyx_v_val = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3; int __pyx_t_4; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":348 * cdef object val * * if self.i == self.n: # <<<<<<<<<<<<<< * self.n = PyList_GET_SIZE(self.newiters) * self.i = 0 */ __pyx_t_1 = ((__pyx_v_self->i == __pyx_v_self->n) != 0); if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":349 * * if self.i == self.n: * self.n = PyList_GET_SIZE(self.newiters) # <<<<<<<<<<<<<< * self.i = 0 * if self.n == 0: */ __pyx_t_2 = __pyx_v_self->newiters; __Pyx_INCREF(__pyx_t_2); __pyx_v_self->n = PyList_GET_SIZE(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":350 * if self.i == self.n: * self.n = PyList_GET_SIZE(self.newiters) * self.i = 0 # <<<<<<<<<<<<<< * if self.n == 0: * raise StopIteration */ __pyx_v_self->i = 0; /* "cytoolz/itertoolz.pyx":351 * self.n = PyList_GET_SIZE(self.newiters) * self.i = 0 * if self.n == 0: # <<<<<<<<<<<<<< * raise StopIteration * self.iters = self.newiters */ __pyx_t_1 = ((__pyx_v_self->n == 0) != 0); if (unlikely(__pyx_t_1)) { /* "cytoolz/itertoolz.pyx":352 * self.i = 0 * if self.n == 0: * raise StopIteration # <<<<<<<<<<<<<< * self.iters = self.newiters * self.newiters = [] */ __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); __PYX_ERR(0, 352, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":351 * self.n = PyList_GET_SIZE(self.newiters) * self.i = 0 * if self.n == 0: # <<<<<<<<<<<<<< * raise StopIteration * self.iters = self.newiters */ } /* "cytoolz/itertoolz.pyx":353 * if self.n == 0: * raise StopIteration * self.iters = self.newiters # <<<<<<<<<<<<<< * self.newiters = [] * val = PyList_GET_ITEM(self.iters, self.i) */ __pyx_t_2 = __pyx_v_self->newiters; __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->iters); __Pyx_DECREF(__pyx_v_self->iters); __pyx_v_self->iters = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":354 * raise StopIteration * self.iters = self.newiters * self.newiters = [] # <<<<<<<<<<<<<< * val = PyList_GET_ITEM(self.iters, self.i) * self.i += 1 */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->newiters); __Pyx_DECREF(__pyx_v_self->newiters); __pyx_v_self->newiters = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":348 * cdef object val * * if self.i == self.n: # <<<<<<<<<<<<<< * self.n = PyList_GET_SIZE(self.newiters) * self.i = 0 */ } /* "cytoolz/itertoolz.pyx":355 * self.iters = self.newiters * self.newiters = [] * val = PyList_GET_ITEM(self.iters, self.i) # <<<<<<<<<<<<<< * self.i += 1 * obj = PtrIter_Next(val) */ __pyx_t_2 = __pyx_v_self->iters; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_v_self->i); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = ((PyObject *)__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_v_val = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":356 * self.newiters = [] * val = PyList_GET_ITEM(self.iters, self.i) * self.i += 1 # <<<<<<<<<<<<<< * obj = PtrIter_Next(val) * */ __pyx_v_self->i = (__pyx_v_self->i + 1); /* "cytoolz/itertoolz.pyx":357 * val = PyList_GET_ITEM(self.iters, self.i) * self.i += 1 * obj = PtrIter_Next(val) # <<<<<<<<<<<<<< * * # TODO: optimization opportunity. Previously, it was possible to */ __pyx_v_obj = PyIter_Next(__pyx_v_val); /* "cytoolz/itertoolz.pyx":362 * # continue on given exceptions, `self.pass_exceptions`, which is * # why this code is structured this way. Time to clean up? * while obj is NULL: # <<<<<<<<<<<<<< * obj = PyErr_Occurred() * if obj is not NULL: */ while (1) { __pyx_t_1 = ((__pyx_v_obj == NULL) != 0); if (!__pyx_t_1) break; /* "cytoolz/itertoolz.pyx":363 * # why this code is structured this way. Time to clean up? * while obj is NULL: * obj = PyErr_Occurred() # <<<<<<<<<<<<<< * if obj is not NULL: * val = obj */ __pyx_v_obj = PyErr_Occurred(); /* "cytoolz/itertoolz.pyx":364 * while obj is NULL: * obj = PyErr_Occurred() * if obj is not NULL: # <<<<<<<<<<<<<< * val = obj * PyErr_Clear() */ __pyx_t_1 = ((__pyx_v_obj != NULL) != 0); if (unlikely(__pyx_t_1)) { /* "cytoolz/itertoolz.pyx":365 * obj = PyErr_Occurred() * if obj is not NULL: * val = obj # <<<<<<<<<<<<<< * PyErr_Clear() * raise val */ __pyx_t_2 = ((PyObject *)__pyx_v_obj); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":366 * if obj is not NULL: * val = obj * PyErr_Clear() # <<<<<<<<<<<<<< * raise val * */ PyErr_Clear(); /* "cytoolz/itertoolz.pyx":367 * val = obj * PyErr_Clear() * raise val # <<<<<<<<<<<<<< * * if self.i == self.n: */ __Pyx_Raise(__pyx_v_val, 0, 0, 0); __PYX_ERR(0, 367, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":364 * while obj is NULL: * obj = PyErr_Occurred() * if obj is not NULL: # <<<<<<<<<<<<<< * val = obj * PyErr_Clear() */ } /* "cytoolz/itertoolz.pyx":369 * raise val * * if self.i == self.n: # <<<<<<<<<<<<<< * self.n = PyList_GET_SIZE(self.newiters) * self.i = 0 */ __pyx_t_1 = ((__pyx_v_self->i == __pyx_v_self->n) != 0); if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":370 * * if self.i == self.n: * self.n = PyList_GET_SIZE(self.newiters) # <<<<<<<<<<<<<< * self.i = 0 * if self.n == 0: */ __pyx_t_2 = __pyx_v_self->newiters; __Pyx_INCREF(__pyx_t_2); __pyx_v_self->n = PyList_GET_SIZE(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":371 * if self.i == self.n: * self.n = PyList_GET_SIZE(self.newiters) * self.i = 0 # <<<<<<<<<<<<<< * if self.n == 0: * raise StopIteration */ __pyx_v_self->i = 0; /* "cytoolz/itertoolz.pyx":372 * self.n = PyList_GET_SIZE(self.newiters) * self.i = 0 * if self.n == 0: # <<<<<<<<<<<<<< * raise StopIteration * self.iters = self.newiters */ __pyx_t_1 = ((__pyx_v_self->n == 0) != 0); if (unlikely(__pyx_t_1)) { /* "cytoolz/itertoolz.pyx":373 * self.i = 0 * if self.n == 0: * raise StopIteration # <<<<<<<<<<<<<< * self.iters = self.newiters * self.newiters = [] */ __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); __PYX_ERR(0, 373, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":372 * self.n = PyList_GET_SIZE(self.newiters) * self.i = 0 * if self.n == 0: # <<<<<<<<<<<<<< * raise StopIteration * self.iters = self.newiters */ } /* "cytoolz/itertoolz.pyx":374 * if self.n == 0: * raise StopIteration * self.iters = self.newiters # <<<<<<<<<<<<<< * self.newiters = [] * val = PyList_GET_ITEM(self.iters, self.i) */ __pyx_t_2 = __pyx_v_self->newiters; __Pyx_INCREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->iters); __Pyx_DECREF(__pyx_v_self->iters); __pyx_v_self->iters = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":375 * raise StopIteration * self.iters = self.newiters * self.newiters = [] # <<<<<<<<<<<<<< * val = PyList_GET_ITEM(self.iters, self.i) * self.i += 1 */ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->newiters); __Pyx_DECREF(__pyx_v_self->newiters); __pyx_v_self->newiters = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":369 * raise val * * if self.i == self.n: # <<<<<<<<<<<<<< * self.n = PyList_GET_SIZE(self.newiters) * self.i = 0 */ } /* "cytoolz/itertoolz.pyx":376 * self.iters = self.newiters * self.newiters = [] * val = PyList_GET_ITEM(self.iters, self.i) # <<<<<<<<<<<<<< * self.i += 1 * obj = PtrIter_Next(val) */ __pyx_t_2 = __pyx_v_self->iters; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_v_self->i); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = ((PyObject *)__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":377 * self.newiters = [] * val = PyList_GET_ITEM(self.iters, self.i) * self.i += 1 # <<<<<<<<<<<<<< * obj = PtrIter_Next(val) * */ __pyx_v_self->i = (__pyx_v_self->i + 1); /* "cytoolz/itertoolz.pyx":378 * val = PyList_GET_ITEM(self.iters, self.i) * self.i += 1 * obj = PtrIter_Next(val) # <<<<<<<<<<<<<< * * PyList_Append(self.newiters, val) */ __pyx_v_obj = PyIter_Next(__pyx_v_val); } /* "cytoolz/itertoolz.pyx":380 * obj = PtrIter_Next(val) * * PyList_Append(self.newiters, val) # <<<<<<<<<<<<<< * val = obj * Py_XDECREF(obj) */ __pyx_t_2 = __pyx_v_self->newiters; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = PyList_Append(__pyx_t_2, __pyx_v_val); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":381 * * PyList_Append(self.newiters, val) * val = obj # <<<<<<<<<<<<<< * Py_XDECREF(obj) * return val */ __pyx_t_2 = ((PyObject *)__pyx_v_obj); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":382 * PyList_Append(self.newiters, val) * val = obj * Py_XDECREF(obj) # <<<<<<<<<<<<<< * return val * */ Py_XDECREF(__pyx_v_obj); /* "cytoolz/itertoolz.pyx":383 * val = obj * Py_XDECREF(obj) * return val # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_val); __pyx_r = __pyx_v_val; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":341 * return self * * def __next__(self): # <<<<<<<<<<<<<< * # This implementation is similar to what is done in `toolz` in that we * # construct a new list of iterators, `self.newiters`, when a value is */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.itertoolz.interleave.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_10interleave_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_10interleave_6__reduce_cython__[] = "interleave.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_10interleave_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_10interleave_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_10interleave_6__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_10interleave_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_10interleave_6__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz_interleave *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_10interleave_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_interleave *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz.interleave.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_10interleave_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_10interleave_8__setstate_cython__[] = "interleave.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_10interleave_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_10interleave_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_10interleave_8__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_10interleave_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_10interleave_8__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz_interleave *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_10interleave_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_interleave *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz.interleave.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":387 * * cdef class _unique_key: * def __cinit__(self, object seq, object key): # <<<<<<<<<<<<<< * self.iter_seq = iter(seq) * self.key = key */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9itertoolz_11_unique_key_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9itertoolz_11_unique_key_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_seq = 0; PyObject *__pyx_v_key = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seq,&__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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 387, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 387, __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_seq = values[0]; __pyx_v_key = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 387, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz._unique_key.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_unique_key___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__unique_key *)__pyx_v_self), __pyx_v_seq, __pyx_v_key); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9itertoolz_11_unique_key___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__unique_key *__pyx_v_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_key) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/itertoolz.pyx":388 * cdef class _unique_key: * def __cinit__(self, object seq, object key): * self.iter_seq = iter(seq) # <<<<<<<<<<<<<< * self.key = key * self.seen = set() */ __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->iter_seq); __Pyx_DECREF(__pyx_v_self->iter_seq); __pyx_v_self->iter_seq = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":389 * def __cinit__(self, object seq, object key): * self.iter_seq = iter(seq) * self.key = key # <<<<<<<<<<<<<< * self.seen = set() * */ __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); __Pyx_GOTREF(__pyx_v_self->key); __Pyx_DECREF(__pyx_v_self->key); __pyx_v_self->key = __pyx_v_key; /* "cytoolz/itertoolz.pyx":390 * self.iter_seq = iter(seq) * self.key = key * self.seen = set() # <<<<<<<<<<<<<< * * def __iter__(self): */ __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->seen); __Pyx_DECREF(__pyx_v_self->seen); __pyx_v_self->seen = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":387 * * cdef class _unique_key: * def __cinit__(self, object seq, object key): # <<<<<<<<<<<<<< * self.iter_seq = iter(seq) * self.key = key */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._unique_key.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":392 * self.seen = set() * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_unique_key_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_unique_key_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_unique_key_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz__unique_key *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_unique_key_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__unique_key *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* "cytoolz/itertoolz.pyx":393 * * 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; /* "cytoolz/itertoolz.pyx":392 * self.seen = set() * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":395 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef object item, tag * item = next(self.iter_seq) */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_unique_key_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_unique_key_5__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_unique_key_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz__unique_key *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_unique_key_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__unique_key *__pyx_v_self) { PyObject *__pyx_v_item = 0; PyObject *__pyx_v_tag = 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_t_6; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":397 * def __next__(self): * cdef object item, tag * item = next(self.iter_seq) # <<<<<<<<<<<<<< * tag = self.key(item) * while PySet_Contains(self.seen, tag): */ __pyx_t_1 = __pyx_v_self->iter_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_item = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":398 * cdef object item, tag * item = next(self.iter_seq) * tag = self.key(item) # <<<<<<<<<<<<<< * while PySet_Contains(self.seen, tag): * item = next(self.iter_seq) */ __Pyx_INCREF(__pyx_v_self->key); __pyx_t_1 = __pyx_v_self->key; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_item); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_tag = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":399 * item = next(self.iter_seq) * tag = self.key(item) * while PySet_Contains(self.seen, tag): # <<<<<<<<<<<<<< * item = next(self.iter_seq) * tag = self.key(item) */ while (1) { __pyx_t_2 = __pyx_v_self->seen; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = PySet_Contains(__pyx_t_2, __pyx_v_tag); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 399, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = (__pyx_t_4 != 0); if (!__pyx_t_5) break; /* "cytoolz/itertoolz.pyx":400 * tag = self.key(item) * while PySet_Contains(self.seen, tag): * item = next(self.iter_seq) # <<<<<<<<<<<<<< * tag = self.key(item) * PySet_Add(self.seen, tag) */ __pyx_t_2 = __pyx_v_self->iter_seq; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_item, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":401 * while PySet_Contains(self.seen, tag): * item = next(self.iter_seq) * tag = self.key(item) # <<<<<<<<<<<<<< * PySet_Add(self.seen, tag) * return item */ __Pyx_INCREF(__pyx_v_self->key); __pyx_t_2 = __pyx_v_self->key; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_item); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_tag, __pyx_t_1); __pyx_t_1 = 0; } /* "cytoolz/itertoolz.pyx":402 * item = next(self.iter_seq) * tag = self.key(item) * PySet_Add(self.seen, tag) # <<<<<<<<<<<<<< * return item * */ __pyx_t_1 = __pyx_v_self->seen; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = PySet_Add(__pyx_t_1, __pyx_v_tag); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":403 * tag = self.key(item) * PySet_Add(self.seen, tag) * return item # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_item); __pyx_r = __pyx_v_item; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":395 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef object item, tag * item = next(self.iter_seq) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.itertoolz._unique_key.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_item); __Pyx_XDECREF(__pyx_v_tag); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_unique_key_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_11_unique_key_6__reduce_cython__[] = "_unique_key.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_11_unique_key_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11_unique_key_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_11_unique_key_6__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_unique_key_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_unique_key_6__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__unique_key *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_unique_key_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__unique_key *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._unique_key.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_unique_key_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_11_unique_key_8__setstate_cython__[] = "_unique_key.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_11_unique_key_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11_unique_key_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_11_unique_key_8__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_unique_key_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_unique_key_8__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__unique_key *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_unique_key_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__unique_key *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._unique_key.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":407 * * cdef class _unique_identity: * def __cinit__(self, object seq): # <<<<<<<<<<<<<< * self.iter_seq = iter(seq) * self.seen = set() */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9itertoolz_16_unique_identity_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9itertoolz_16_unique_identity_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_seq = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seq,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); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 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, "__cinit__") < 0)) __PYX_ERR(0, 407, __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_seq = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 407, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz._unique_identity.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_16_unique_identity___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *)__pyx_v_self), __pyx_v_seq); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9itertoolz_16_unique_identity___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *__pyx_v_self, PyObject *__pyx_v_seq) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/itertoolz.pyx":408 * cdef class _unique_identity: * def __cinit__(self, object seq): * self.iter_seq = iter(seq) # <<<<<<<<<<<<<< * self.seen = set() * */ __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->iter_seq); __Pyx_DECREF(__pyx_v_self->iter_seq); __pyx_v_self->iter_seq = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":409 * def __cinit__(self, object seq): * self.iter_seq = iter(seq) * self.seen = set() # <<<<<<<<<<<<<< * * def __iter__(self): */ __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->seen); __Pyx_DECREF(__pyx_v_self->seen); __pyx_v_self->seen = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":407 * * cdef class _unique_identity: * def __cinit__(self, object seq): # <<<<<<<<<<<<<< * self.iter_seq = iter(seq) * self.seen = set() */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._unique_identity.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":411 * self.seen = set() * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_16_unique_identity_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_16_unique_identity_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_16_unique_identity_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_16_unique_identity_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* "cytoolz/itertoolz.pyx":412 * * 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; /* "cytoolz/itertoolz.pyx":411 * self.seen = set() * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":414 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef object item * item = next(self.iter_seq) */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_16_unique_identity_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_16_unique_identity_5__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_16_unique_identity_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_16_unique_identity_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *__pyx_v_self) { PyObject *__pyx_v_item = 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; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":416 * def __next__(self): * cdef object item * item = next(self.iter_seq) # <<<<<<<<<<<<<< * while PySet_Contains(self.seen, item): * item = next(self.iter_seq) */ __pyx_t_1 = __pyx_v_self->iter_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_item = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":417 * cdef object item * item = next(self.iter_seq) * while PySet_Contains(self.seen, item): # <<<<<<<<<<<<<< * item = next(self.iter_seq) * PySet_Add(self.seen, item) */ while (1) { __pyx_t_2 = __pyx_v_self->seen; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = PySet_Contains(__pyx_t_2, __pyx_v_item); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 != 0); if (!__pyx_t_4) break; /* "cytoolz/itertoolz.pyx":418 * item = next(self.iter_seq) * while PySet_Contains(self.seen, item): * item = next(self.iter_seq) # <<<<<<<<<<<<<< * PySet_Add(self.seen, item) * return item */ __pyx_t_2 = __pyx_v_self->iter_seq; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_item, __pyx_t_1); __pyx_t_1 = 0; } /* "cytoolz/itertoolz.pyx":419 * while PySet_Contains(self.seen, item): * item = next(self.iter_seq) * PySet_Add(self.seen, item) # <<<<<<<<<<<<<< * return item * */ __pyx_t_1 = __pyx_v_self->seen; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = PySet_Add(__pyx_t_1, __pyx_v_item); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":420 * item = next(self.iter_seq) * PySet_Add(self.seen, item) * return item # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_item); __pyx_r = __pyx_v_item; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":414 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef object item * item = next(self.iter_seq) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.itertoolz._unique_identity.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_item); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_16_unique_identity_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_16_unique_identity_6__reduce_cython__[] = "_unique_identity.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_16_unique_identity_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_16_unique_identity_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_16_unique_identity_6__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_16_unique_identity_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_16_unique_identity_6__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_16_unique_identity_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._unique_identity.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_16_unique_identity_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_16_unique_identity_8__setstate_cython__[] = "_unique_identity.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_16_unique_identity_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_16_unique_identity_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_16_unique_identity_8__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_16_unique_identity_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_16_unique_identity_8__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_16_unique_identity_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._unique_identity.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":423 * * * cpdef object unique(object seq, object key=None): # <<<<<<<<<<<<<< * """ * Return only unique elements of a sequence */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_7unique(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_unique(PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_unique *__pyx_optional_args) { PyObject *__pyx_v_key = ((PyObject *)Py_None); PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("unique", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_key = __pyx_optional_args->key; } } /* "cytoolz/itertoolz.pyx":437 * ('cat', 'mouse') * """ * if key is None: # <<<<<<<<<<<<<< * return _unique_identity(seq) * else: */ __pyx_t_1 = (__pyx_v_key == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":438 * """ * if key is None: * return _unique_identity(seq) # <<<<<<<<<<<<<< * else: * return _unique_key(seq, key) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__unique_identity), __pyx_v_seq); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":437 * ('cat', 'mouse') * """ * if key is None: # <<<<<<<<<<<<<< * return _unique_identity(seq) * else: */ } /* "cytoolz/itertoolz.pyx":440 * return _unique_identity(seq) * else: * return _unique_key(seq, key) # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_seq); __Pyx_GIVEREF(__pyx_v_seq); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_seq); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_key); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__unique_key), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 440, __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; } /* "cytoolz/itertoolz.pyx":423 * * * cpdef object unique(object seq, object key=None): # <<<<<<<<<<<<<< * """ * Return only unique elements of a sequence */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("cytoolz.itertoolz.unique", __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_7cytoolz_9itertoolz_7unique(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_6unique[] = "unique(seq, key=None)\n\n Return only unique elements of a sequence\n\n >>> tuple(unique((1, 2, 3)))\n (1, 2, 3)\n >>> tuple(unique((1, 2, 1, 3)))\n (1, 2, 3)\n\n Uniqueness can be defined by key keyword\n\n >>> tuple(unique(['cat', 'mouse', 'dog', 'hen'], key=len))\n ('cat', 'mouse')\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_7unique = {"unique", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9itertoolz_7unique, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9itertoolz_6unique}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_7unique(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_seq = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("unique (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seq,&__pyx_n_s_key,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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unique") < 0)) __PYX_ERR(0, 423, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_seq = values[0]; __pyx_v_key = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("unique", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 423, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.unique", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_6unique(__pyx_self, __pyx_v_seq, __pyx_v_key); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_6unique(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_7cytoolz_9itertoolz_unique __pyx_t_2; __Pyx_RefNannySetupContext("unique", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.key = __pyx_v_key; __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_unique(__pyx_v_seq, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.unique", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":443 * * * cpdef object isiterable(object x): # <<<<<<<<<<<<<< * """ * Is x iterable? */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_9isiterable(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_isiterable(PyObject *__pyx_v_x, 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; __Pyx_RefNannySetupContext("isiterable", 0); /* "cytoolz/itertoolz.pyx":454 * False * """ * try: # <<<<<<<<<<<<<< * iter(x) * return True */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __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:*/ { /* "cytoolz/itertoolz.pyx":455 * """ * try: * iter(x) # <<<<<<<<<<<<<< * return True * except TypeError: */ __pyx_t_4 = PyObject_GetIter(__pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 455, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/itertoolz.pyx":456 * try: * iter(x) * return True # <<<<<<<<<<<<<< * except TypeError: * pass */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L7_try_return; /* "cytoolz/itertoolz.pyx":454 * False * """ * try: # <<<<<<<<<<<<<< * iter(x) * return True */ } __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/itertoolz.pyx":457 * iter(x) * return True * except TypeError: # <<<<<<<<<<<<<< * pass * return False */ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_5) { __Pyx_ErrRestore(0,0,0); goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "cytoolz/itertoolz.pyx":454 * False * """ * try: # <<<<<<<<<<<<<< * iter(x) * return True */ __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); } /* "cytoolz/itertoolz.pyx":459 * except TypeError: * pass * return False # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":443 * * * cpdef object isiterable(object x): # <<<<<<<<<<<<<< * """ * Is x iterable? */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("cytoolz.itertoolz.isiterable", __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_7cytoolz_9itertoolz_9isiterable(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_8isiterable[] = "isiterable(x)\n\n Is x iterable?\n\n >>> isiterable([1, 2, 3])\n True\n >>> isiterable('abc')\n True\n >>> isiterable(5)\n False\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_9isiterable = {"isiterable", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_9isiterable, METH_O, __pyx_doc_7cytoolz_9itertoolz_8isiterable}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_9isiterable(PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isiterable (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_8isiterable(__pyx_self, ((PyObject *)__pyx_v_x)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_8isiterable(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("isiterable", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_isiterable(__pyx_v_x, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.isiterable", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":462 * * * cpdef object isdistinct(object seq): # <<<<<<<<<<<<<< * """ * All values in sequence are distinct */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11isdistinct(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_isdistinct(PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_v_seen = NULL; PyObject *__pyx_v_item = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; int __pyx_t_7; Py_ssize_t __pyx_t_8; __Pyx_RefNannySetupContext("isdistinct", 0); /* "cytoolz/itertoolz.pyx":476 * True * """ * if iter(seq) is seq: # <<<<<<<<<<<<<< * seen = set() * for item in seq: */ __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_t_1 == __pyx_v_seq); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "cytoolz/itertoolz.pyx":477 * """ * if iter(seq) is seq: * seen = set() # <<<<<<<<<<<<<< * for item in seq: * if PySet_Contains(seen, item): */ __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_seen = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":478 * if iter(seq) is seq: * seen = set() * for item in seq: # <<<<<<<<<<<<<< * if PySet_Contains(seen, item): * return False */ if (likely(PyList_CheckExact(__pyx_v_seq)) || PyTuple_CheckExact(__pyx_v_seq)) { __pyx_t_1 = __pyx_v_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 478, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_5)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 478, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 478, __pyx_L1_error) #else __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } } else { __pyx_t_6 = __pyx_t_5(__pyx_t_1); if (unlikely(!__pyx_t_6)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 478, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_6); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_6); __pyx_t_6 = 0; /* "cytoolz/itertoolz.pyx":479 * seen = set() * for item in seq: * if PySet_Contains(seen, item): # <<<<<<<<<<<<<< * return False * seen.add(item) */ __pyx_t_3 = PySet_Contains(__pyx_v_seen, __pyx_v_item); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 479, __pyx_L1_error) __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":480 * for item in seq: * if PySet_Contains(seen, item): * return False # <<<<<<<<<<<<<< * seen.add(item) * return True */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":479 * seen = set() * for item in seq: * if PySet_Contains(seen, item): # <<<<<<<<<<<<<< * return False * seen.add(item) */ } /* "cytoolz/itertoolz.pyx":481 * if PySet_Contains(seen, item): * return False * seen.add(item) # <<<<<<<<<<<<<< * return True * else: */ __pyx_t_7 = PySet_Add(__pyx_v_seen, __pyx_v_item); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 481, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":478 * if iter(seq) is seq: * seen = set() * for item in seq: # <<<<<<<<<<<<<< * if PySet_Contains(seen, item): * return False */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":482 * return False * seen.add(item) * return True # <<<<<<<<<<<<<< * else: * return len(seq) == len(set(seq)) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":476 * True * """ * if iter(seq) is seq: # <<<<<<<<<<<<<< * seen = set() * for item in seq: */ } /* "cytoolz/itertoolz.pyx":484 * return True * else: * return len(seq) == len(set(seq)) # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyObject_Length(__pyx_v_seq); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 484, __pyx_L1_error) __pyx_t_1 = PySet_New(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = PySet_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_t_4 == __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } /* "cytoolz/itertoolz.pyx":462 * * * cpdef object isdistinct(object seq): # <<<<<<<<<<<<<< * """ * All values in sequence are distinct */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("cytoolz.itertoolz.isdistinct", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_seen); __Pyx_XDECREF(__pyx_v_item); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11isdistinct(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_10isdistinct[] = "isdistinct(seq)\n\n All values in sequence are distinct\n\n >>> isdistinct([1, 2, 3])\n True\n >>> isdistinct([1, 2, 1])\n False\n\n >>> isdistinct(\"Hello\")\n False\n >>> isdistinct(\"World\")\n True\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_11isdistinct = {"isdistinct", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11isdistinct, METH_O, __pyx_doc_7cytoolz_9itertoolz_10isdistinct}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_11isdistinct(PyObject *__pyx_self, PyObject *__pyx_v_seq) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isdistinct (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_10isdistinct(__pyx_self, ((PyObject *)__pyx_v_seq)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_10isdistinct(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("isdistinct", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_isdistinct(__pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.isdistinct", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":487 * * * cpdef object take(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * The first n elements of a sequence */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13take(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_take(Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq, 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; __Pyx_RefNannySetupContext("take", 0); /* "cytoolz/itertoolz.pyx":498 * tail * """ * return islice(seq, n) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_islice); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_seq, __pyx_t_3}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_seq, __pyx_t_3}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_seq); __Pyx_GIVEREF(__pyx_v_seq); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_seq); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __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_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":487 * * * cpdef object take(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * The first n elements of a sequence */ /* 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_6); __Pyx_AddTraceback("cytoolz.itertoolz.take", __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_7cytoolz_9itertoolz_13take(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_12take[] = "take(Py_ssize_t n, seq)\n\n The first n elements of a sequence\n\n >>> list(take(2, [10, 20, 30, 40, 50]))\n [10, 20]\n\n See Also:\n drop\n tail\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_13take = {"take", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9itertoolz_13take, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9itertoolz_12take}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_13take(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { Py_ssize_t __pyx_v_n; PyObject *__pyx_v_seq = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("take (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_seq,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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("take", 1, 2, 2, 1); __PYX_ERR(0, 487, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take") < 0)) __PYX_ERR(0, 487, __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_n = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_n == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 487, __pyx_L3_error) __pyx_v_seq = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("take", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 487, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.take", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_12take(__pyx_self, __pyx_v_n, __pyx_v_seq); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_12take(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("take", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_take(__pyx_v_n, __pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.take", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":501 * * * cpdef object tail(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * The last n elements of a sequence */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_15tail(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_tail(Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq, 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_t_6; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("tail", 0); /* "cytoolz/itertoolz.pyx":512 * take * """ * if PySequence_Check(seq): # <<<<<<<<<<<<<< * return seq[-n:] * return tuple(deque(seq, n)) */ __pyx_t_1 = (PySequence_Check(__pyx_v_seq) != 0); if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":513 * """ * if PySequence_Check(seq): * return seq[-n:] # <<<<<<<<<<<<<< * return tuple(deque(seq, n)) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_seq, (-__pyx_v_n), 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":512 * take * """ * if PySequence_Check(seq): # <<<<<<<<<<<<<< * return seq[-n:] * return tuple(deque(seq, n)) */ } /* "cytoolz/itertoolz.pyx":514 * if PySequence_Check(seq): * return seq[-n:] * return tuple(deque(seq, n)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_deque); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_seq, __pyx_t_4}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_seq, __pyx_t_4}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_seq); __Pyx_GIVEREF(__pyx_v_seq); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_seq); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __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; /* "cytoolz/itertoolz.pyx":501 * * * cpdef object tail(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * The last n elements of a sequence */ /* 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); __Pyx_AddTraceback("cytoolz.itertoolz.tail", __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_7cytoolz_9itertoolz_15tail(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_14tail[] = "tail(Py_ssize_t n, seq)\n\n The last n elements of a sequence\n\n >>> tail(2, [10, 20, 30, 40, 50])\n [40, 50]\n\n See Also:\n drop\n take\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_15tail = {"tail", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9itertoolz_15tail, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9itertoolz_14tail}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_15tail(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { Py_ssize_t __pyx_v_n; PyObject *__pyx_v_seq = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("tail (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_seq,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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("tail", 1, 2, 2, 1); __PYX_ERR(0, 501, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tail") < 0)) __PYX_ERR(0, 501, __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_n = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_n == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 501, __pyx_L3_error) __pyx_v_seq = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("tail", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 501, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.tail", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_14tail(__pyx_self, __pyx_v_n, __pyx_v_seq); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_14tail(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("tail", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_tail(__pyx_v_n, __pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.tail", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":517 * * * cpdef object drop(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * The sequence following the first n elements */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_17drop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_drop(Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) { CYTHON_UNUSED Py_ssize_t __pyx_v_i; PyObject *__pyx_v_iter_seq = 0; 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; Py_ssize_t __pyx_t_6; Py_ssize_t __pyx_t_7; Py_ssize_t __pyx_t_8; int __pyx_t_9; __Pyx_RefNannySetupContext("drop", 0); /* "cytoolz/itertoolz.pyx":528 * tail * """ * if n < 0: # <<<<<<<<<<<<<< * raise ValueError('n argument for drop() must be non-negative') * cdef Py_ssize_t i */ __pyx_t_1 = ((__pyx_v_n < 0) != 0); if (unlikely(__pyx_t_1)) { /* "cytoolz/itertoolz.pyx":529 * """ * if n < 0: * raise ValueError('n argument for drop() must be non-negative') # <<<<<<<<<<<<<< * cdef Py_ssize_t i * cdef object iter_seq */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 529, __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_ERR(0, 529, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":528 * tail * """ * if n < 0: # <<<<<<<<<<<<<< * raise ValueError('n argument for drop() must be non-negative') * cdef Py_ssize_t i */ } /* "cytoolz/itertoolz.pyx":532 * cdef Py_ssize_t i * cdef object iter_seq * iter_seq = iter(seq) # <<<<<<<<<<<<<< * try: * for i in range(n): */ __pyx_t_2 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_iter_seq = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":533 * cdef object iter_seq * iter_seq = iter(seq) * try: # <<<<<<<<<<<<<< * for i in range(n): * next(iter_seq) */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __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:*/ { /* "cytoolz/itertoolz.pyx":534 * iter_seq = iter(seq) * try: * for i in range(n): # <<<<<<<<<<<<<< * next(iter_seq) * except StopIteration: */ __pyx_t_6 = __pyx_v_n; __pyx_t_7 = __pyx_t_6; for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) { __pyx_v_i = __pyx_t_8; /* "cytoolz/itertoolz.pyx":535 * try: * for i in range(n): * next(iter_seq) # <<<<<<<<<<<<<< * except StopIteration: * pass */ __pyx_t_2 = __Pyx_PyIter_Next(__pyx_v_iter_seq); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "cytoolz/itertoolz.pyx":533 * cdef object iter_seq * iter_seq = iter(seq) * try: # <<<<<<<<<<<<<< * for i in range(n): * next(iter_seq) */ } __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_L4_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":536 * for i in range(n): * next(iter_seq) * except StopIteration: # <<<<<<<<<<<<<< * pass * return iter_seq */ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_9) { __Pyx_ErrRestore(0,0,0); goto __pyx_L5_exception_handled; } goto __pyx_L6_except_error; __pyx_L6_except_error:; /* "cytoolz/itertoolz.pyx":533 * cdef object iter_seq * iter_seq = iter(seq) * try: # <<<<<<<<<<<<<< * for i in range(n): * next(iter_seq) */ __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_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_L9_try_end:; } /* "cytoolz/itertoolz.pyx":538 * except StopIteration: * pass * return iter_seq # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_iter_seq); __pyx_r = __pyx_v_iter_seq; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":517 * * * cpdef object drop(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * The sequence following the first n elements */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.itertoolz.drop", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_iter_seq); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_17drop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_16drop[] = "drop(Py_ssize_t n, seq)\n\n The sequence following the first n elements\n\n >>> list(drop(2, [10, 20, 30, 40, 50]))\n [30, 40, 50]\n\n See Also:\n take\n tail\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_17drop = {"drop", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9itertoolz_17drop, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9itertoolz_16drop}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_17drop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { Py_ssize_t __pyx_v_n; PyObject *__pyx_v_seq = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("drop (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_seq,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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("drop", 1, 2, 2, 1); __PYX_ERR(0, 517, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "drop") < 0)) __PYX_ERR(0, 517, __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_n = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_n == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 517, __pyx_L3_error) __pyx_v_seq = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("drop", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 517, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.drop", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_16drop(__pyx_self, __pyx_v_n, __pyx_v_seq); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_16drop(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("drop", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_drop(__pyx_v_n, __pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.drop", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":541 * * * cpdef object take_nth(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * Every nth item in seq */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_19take_nth(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_take_nth(Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq, 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; __Pyx_RefNannySetupContext("take_nth", 0); /* "cytoolz/itertoolz.pyx":548 * [10, 30, 50] * """ * return islice(seq, 0, None, n) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_islice); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_seq, __pyx_int_0, Py_None, __pyx_t_3}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_seq, __pyx_int_0, Py_None, __pyx_t_3}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(__pyx_v_seq); __Pyx_GIVEREF(__pyx_v_seq); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_seq); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_int_0); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, Py_None); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __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_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":541 * * * cpdef object take_nth(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * Every nth item in seq */ /* 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_6); __Pyx_AddTraceback("cytoolz.itertoolz.take_nth", __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_7cytoolz_9itertoolz_19take_nth(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_18take_nth[] = "take_nth(Py_ssize_t n, seq)\n\n Every nth item in seq\n\n >>> list(take_nth(2, [10, 20, 30, 40, 50]))\n [10, 30, 50]\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_19take_nth = {"take_nth", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9itertoolz_19take_nth, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9itertoolz_18take_nth}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_19take_nth(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { Py_ssize_t __pyx_v_n; PyObject *__pyx_v_seq = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("take_nth (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_seq,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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("take_nth", 1, 2, 2, 1); __PYX_ERR(0, 541, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "take_nth") < 0)) __PYX_ERR(0, 541, __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_n = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_n == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 541, __pyx_L3_error) __pyx_v_seq = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("take_nth", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 541, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.take_nth", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_18take_nth(__pyx_self, __pyx_v_n, __pyx_v_seq); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_18take_nth(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("take_nth", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_take_nth(__pyx_v_n, __pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.take_nth", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":551 * * * cpdef object first(object seq): # <<<<<<<<<<<<<< * """ * The first element in a sequence */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_21first(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_first(PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("first", 0); /* "cytoolz/itertoolz.pyx":558 * 'A' * """ * return next(iter(seq)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __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; /* "cytoolz/itertoolz.pyx":551 * * * cpdef object first(object seq): # <<<<<<<<<<<<<< * """ * The first element in a sequence */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.itertoolz.first", __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_7cytoolz_9itertoolz_21first(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_20first[] = "first(seq)\n\n The first element in a sequence\n\n >>> first('ABC')\n 'A'\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_21first = {"first", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_21first, METH_O, __pyx_doc_7cytoolz_9itertoolz_20first}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_21first(PyObject *__pyx_self, PyObject *__pyx_v_seq) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("first (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_20first(__pyx_self, ((PyObject *)__pyx_v_seq)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_20first(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("first", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_first(__pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.first", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":561 * * * cpdef object second(object seq): # <<<<<<<<<<<<<< * """ * The second element in a sequence */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_23second(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_second(PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("second", 0); __Pyx_INCREF(__pyx_v_seq); /* "cytoolz/itertoolz.pyx":568 * 'B' * """ * seq = iter(seq) # <<<<<<<<<<<<<< * next(seq) * return next(seq) */ __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_seq, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":569 * """ * seq = iter(seq) * next(seq) # <<<<<<<<<<<<<< * return next(seq) * */ __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":570 * seq = iter(seq) * next(seq) * return next(seq) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":561 * * * cpdef object second(object seq): # <<<<<<<<<<<<<< * """ * The second element in a sequence */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz.second", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_seq); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_23second(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_22second[] = "second(seq)\n\n The second element in a sequence\n\n >>> second('ABC')\n 'B'\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_23second = {"second", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_23second, METH_O, __pyx_doc_7cytoolz_9itertoolz_22second}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_23second(PyObject *__pyx_self, PyObject *__pyx_v_seq) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("second (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_22second(__pyx_self, ((PyObject *)__pyx_v_seq)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_22second(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("second", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_second(__pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.second", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":573 * * * cpdef object nth(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * The nth element in a sequence */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_25nth(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_nth(Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("nth", 0); __Pyx_INCREF(__pyx_v_seq); /* "cytoolz/itertoolz.pyx":580 * 'B' * """ * if PySequence_Check(seq): # <<<<<<<<<<<<<< * return seq[n] * if n < 0: */ __pyx_t_1 = (PySequence_Check(__pyx_v_seq) != 0); if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":581 * """ * if PySequence_Check(seq): * return seq[n] # <<<<<<<<<<<<<< * if n < 0: * raise ValueError('"n" must be positive when indexing an iterator') */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_seq, __pyx_v_n, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":580 * 'B' * """ * if PySequence_Check(seq): # <<<<<<<<<<<<<< * return seq[n] * if n < 0: */ } /* "cytoolz/itertoolz.pyx":582 * if PySequence_Check(seq): * return seq[n] * if n < 0: # <<<<<<<<<<<<<< * raise ValueError('"n" must be positive when indexing an iterator') * seq = iter(seq) */ __pyx_t_1 = ((__pyx_v_n < 0) != 0); if (unlikely(__pyx_t_1)) { /* "cytoolz/itertoolz.pyx":583 * return seq[n] * if n < 0: * raise ValueError('"n" must be positive when indexing an iterator') # <<<<<<<<<<<<<< * seq = iter(seq) * while n > 0: */ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __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_ERR(0, 583, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":582 * if PySequence_Check(seq): * return seq[n] * if n < 0: # <<<<<<<<<<<<<< * raise ValueError('"n" must be positive when indexing an iterator') * seq = iter(seq) */ } /* "cytoolz/itertoolz.pyx":584 * if n < 0: * raise ValueError('"n" must be positive when indexing an iterator') * seq = iter(seq) # <<<<<<<<<<<<<< * while n > 0: * n -= 1 */ __pyx_t_2 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_seq, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":585 * raise ValueError('"n" must be positive when indexing an iterator') * seq = iter(seq) * while n > 0: # <<<<<<<<<<<<<< * n -= 1 * next(seq) */ while (1) { __pyx_t_1 = ((__pyx_v_n > 0) != 0); if (!__pyx_t_1) break; /* "cytoolz/itertoolz.pyx":586 * seq = iter(seq) * while n > 0: * n -= 1 # <<<<<<<<<<<<<< * next(seq) * return next(seq) */ __pyx_v_n = (__pyx_v_n - 1); /* "cytoolz/itertoolz.pyx":587 * while n > 0: * n -= 1 * next(seq) # <<<<<<<<<<<<<< * return next(seq) * */ __pyx_t_2 = __Pyx_PyIter_Next(__pyx_v_seq); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } /* "cytoolz/itertoolz.pyx":588 * n -= 1 * next(seq) * return next(seq) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyIter_Next(__pyx_v_seq); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":573 * * * cpdef object nth(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * The nth element in a sequence */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.itertoolz.nth", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_seq); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_25nth(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_24nth[] = "nth(Py_ssize_t n, seq)\n\n The nth element in a sequence\n\n >>> nth(1, 'ABC')\n 'B'\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_25nth = {"nth", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9itertoolz_25nth, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9itertoolz_24nth}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_25nth(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { Py_ssize_t __pyx_v_n; PyObject *__pyx_v_seq = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("nth (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_seq,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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("nth", 1, 2, 2, 1); __PYX_ERR(0, 573, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "nth") < 0)) __PYX_ERR(0, 573, __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_n = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_n == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 573, __pyx_L3_error) __pyx_v_seq = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("nth", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 573, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.nth", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_24nth(__pyx_self, __pyx_v_n, __pyx_v_seq); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_24nth(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("nth", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_nth(__pyx_v_n, __pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.nth", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":591 * * * cpdef object last(object seq): # <<<<<<<<<<<<<< * """ * The last element in a sequence */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_27last(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_last(PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_v_val = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("last", 0); /* "cytoolz/itertoolz.pyx":599 * """ * cdef object val * if PySequence_Check(seq): # <<<<<<<<<<<<<< * return seq[-1] * val = no_default */ __pyx_t_1 = (PySequence_Check(__pyx_v_seq) != 0); if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":600 * cdef object val * if PySequence_Check(seq): * return seq[-1] # <<<<<<<<<<<<<< * val = no_default * for val in seq: */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_seq, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":599 * """ * cdef object val * if PySequence_Check(seq): # <<<<<<<<<<<<<< * return seq[-1] * val = no_default */ } /* "cytoolz/itertoolz.pyx":601 * if PySequence_Check(seq): * return seq[-1] * val = no_default # <<<<<<<<<<<<<< * for val in seq: * pass */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_val = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":602 * return seq[-1] * val = no_default * for val in seq: # <<<<<<<<<<<<<< * pass * if val == no_default: */ if (likely(PyList_CheckExact(__pyx_v_seq)) || PyTuple_CheckExact(__pyx_v_seq)) { __pyx_t_2 = __pyx_v_seq; __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_seq); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_4)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 602, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 602, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 602, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":604 * for val in seq: * pass * if val == no_default: # <<<<<<<<<<<<<< * raise IndexError * return val */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = PyObject_RichCompare(__pyx_v_val, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 604, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(__pyx_t_1)) { /* "cytoolz/itertoolz.pyx":605 * pass * if val == no_default: * raise IndexError # <<<<<<<<<<<<<< * return val * */ __Pyx_Raise(__pyx_builtin_IndexError, 0, 0, 0); __PYX_ERR(0, 605, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":604 * for val in seq: * pass * if val == no_default: # <<<<<<<<<<<<<< * raise IndexError * return val */ } /* "cytoolz/itertoolz.pyx":606 * if val == no_default: * raise IndexError * return val # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_val); __pyx_r = __pyx_v_val; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":591 * * * cpdef object last(object seq): # <<<<<<<<<<<<<< * """ * The last element in a sequence */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("cytoolz.itertoolz.last", __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_7cytoolz_9itertoolz_27last(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_26last[] = "last(seq)\n\n The last element in a sequence\n\n >>> last('ABC')\n 'C'\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_27last = {"last", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_27last, METH_O, __pyx_doc_7cytoolz_9itertoolz_26last}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_27last(PyObject *__pyx_self, PyObject *__pyx_v_seq) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("last (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_26last(__pyx_self, ((PyObject *)__pyx_v_seq)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_26last(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("last", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_last(__pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.last", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":609 * * * cpdef object rest(object seq): # <<<<<<<<<<<<<< * seq = iter(seq) * next(seq) */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_29rest(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_rest(PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("rest", 0); __Pyx_INCREF(__pyx_v_seq); /* "cytoolz/itertoolz.pyx":610 * * cpdef object rest(object seq): * seq = iter(seq) # <<<<<<<<<<<<<< * next(seq) * return seq */ __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_seq, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":611 * cpdef object rest(object seq): * seq = iter(seq) * next(seq) # <<<<<<<<<<<<<< * return seq * */ __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":612 * seq = iter(seq) * next(seq) * return seq # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_seq); __pyx_r = __pyx_v_seq; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":609 * * * cpdef object rest(object seq): # <<<<<<<<<<<<<< * seq = iter(seq) * next(seq) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz.rest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_seq); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_29rest(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_28rest[] = "rest(seq)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_29rest = {"rest", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_29rest, METH_O, __pyx_doc_7cytoolz_9itertoolz_28rest}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_29rest(PyObject *__pyx_self, PyObject *__pyx_v_seq) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rest (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_28rest(__pyx_self, ((PyObject *)__pyx_v_seq)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_28rest(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("rest", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_rest(__pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.rest", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":619 * * * cpdef object get(object ind, object seq, object default='__no__default__'): # <<<<<<<<<<<<<< * """ * Get element in a sequence or dict */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_31get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_get(PyObject *__pyx_v_ind, PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_get *__pyx_optional_args) { PyObject *__pyx_v_default = ((PyObject *)__pyx_n_s_no__default); Py_ssize_t __pyx_v_i; PyObject *__pyx_v_val = 0; PyObject *__pyx_v_result = 0; 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; Py_ssize_t __pyx_t_5; Py_ssize_t __pyx_t_6; PyObject *(*__pyx_t_7)(PyObject *); PyObject *__pyx_t_8; __Pyx_RefNannySetupContext("get", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default = __pyx_optional_args->__pyx_default; } } /* "cytoolz/itertoolz.pyx":657 * cdef tuple result * cdef PyObject *obj * if isinstance(ind, list): # <<<<<<<<<<<<<< * i = PyList_GET_SIZE(ind) * result = PyTuple_New(i) */ __pyx_t_1 = PyList_Check(__pyx_v_ind); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":658 * cdef PyObject *obj * if isinstance(ind, list): * i = PyList_GET_SIZE(ind) # <<<<<<<<<<<<<< * result = PyTuple_New(i) * # List of indices, no default */ __pyx_v_i = PyList_GET_SIZE(__pyx_v_ind); /* "cytoolz/itertoolz.pyx":659 * if isinstance(ind, list): * i = PyList_GET_SIZE(ind) * result = PyTuple_New(i) # <<<<<<<<<<<<<< * # List of indices, no default * if default == no_default: */ __pyx_t_3 = PyTuple_New(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_result = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/itertoolz.pyx":661 * result = PyTuple_New(i) * # List of indices, no default * if default == no_default: # <<<<<<<<<<<<<< * for i, val in enumerate(ind): * val = seq[val] */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_no_default); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_v_default, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 661, __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_ERR(0, 661, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":662 * # List of indices, no default * if default == no_default: * for i, val in enumerate(ind): # <<<<<<<<<<<<<< * val = seq[val] * Py_INCREF(val) */ __pyx_t_5 = 0; if (likely(PyList_CheckExact(__pyx_v_ind)) || PyTuple_CheckExact(__pyx_v_ind)) { __pyx_t_4 = __pyx_v_ind; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 662, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 662, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 662, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 662, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 662, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3); __pyx_t_3 = 0; __pyx_v_i = __pyx_t_5; __pyx_t_5 = (__pyx_t_5 + 1); /* "cytoolz/itertoolz.pyx":663 * if default == no_default: * for i, val in enumerate(ind): * val = seq[val] # <<<<<<<<<<<<<< * Py_INCREF(val) * PyTuple_SET_ITEM(result, i, val) */ __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_seq, __pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/itertoolz.pyx":664 * for i, val in enumerate(ind): * val = seq[val] * Py_INCREF(val) # <<<<<<<<<<<<<< * PyTuple_SET_ITEM(result, i, val) * return result */ Py_INCREF(__pyx_v_val); /* "cytoolz/itertoolz.pyx":665 * val = seq[val] * Py_INCREF(val) * PyTuple_SET_ITEM(result, i, val) # <<<<<<<<<<<<<< * return result * */ PyTuple_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_val); /* "cytoolz/itertoolz.pyx":662 * # List of indices, no default * if default == no_default: * for i, val in enumerate(ind): # <<<<<<<<<<<<<< * val = seq[val] * Py_INCREF(val) */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/itertoolz.pyx":666 * Py_INCREF(val) * PyTuple_SET_ITEM(result, i, val) * return result # <<<<<<<<<<<<<< * * # List of indices with default */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":661 * result = PyTuple_New(i) * # List of indices, no default * if default == no_default: # <<<<<<<<<<<<<< * for i, val in enumerate(ind): * val = seq[val] */ } /* "cytoolz/itertoolz.pyx":669 * * # List of indices with default * for i, val in enumerate(ind): # <<<<<<<<<<<<<< * obj = PtrObject_GetItem(seq, val) * if obj is NULL: */ __pyx_t_5 = 0; if (likely(PyList_CheckExact(__pyx_v_ind)) || PyTuple_CheckExact(__pyx_v_ind)) { __pyx_t_4 = __pyx_v_ind; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 669, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { if (likely(PyList_CheckExact(__pyx_t_4))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 669, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 669, __pyx_L1_error) #else __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } } else { __pyx_t_3 = __pyx_t_7(__pyx_t_4); if (unlikely(!__pyx_t_3)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 669, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3); __pyx_t_3 = 0; __pyx_v_i = __pyx_t_5; __pyx_t_5 = (__pyx_t_5 + 1); /* "cytoolz/itertoolz.pyx":670 * # List of indices with default * for i, val in enumerate(ind): * obj = PtrObject_GetItem(seq, val) # <<<<<<<<<<<<<< * if obj is NULL: * val = PyErr_Occurred() */ __pyx_v_obj = PyObject_GetItem(__pyx_v_seq, __pyx_v_val); /* "cytoolz/itertoolz.pyx":671 * for i, val in enumerate(ind): * obj = PtrObject_GetItem(seq, val) * if obj is NULL: # <<<<<<<<<<<<<< * val = PyErr_Occurred() * PyErr_Clear() */ __pyx_t_2 = ((__pyx_v_obj == NULL) != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":672 * obj = PtrObject_GetItem(seq, val) * if obj is NULL: * val = PyErr_Occurred() # <<<<<<<<<<<<<< * PyErr_Clear() * if not PyErr_GivenExceptionMatches(val, _get_list_exc): */ __pyx_t_8 = PyErr_Occurred(); __pyx_t_3 = ((PyObject *)__pyx_t_8); __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/itertoolz.pyx":673 * if obj is NULL: * val = PyErr_Occurred() * PyErr_Clear() # <<<<<<<<<<<<<< * if not PyErr_GivenExceptionMatches(val, _get_list_exc): * raise val */ PyErr_Clear(); /* "cytoolz/itertoolz.pyx":674 * val = PyErr_Occurred() * PyErr_Clear() * if not PyErr_GivenExceptionMatches(val, _get_list_exc): # <<<<<<<<<<<<<< * raise val * Py_INCREF(default) */ __pyx_t_3 = __pyx_v_7cytoolz_9itertoolz__get_list_exc; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = ((!(PyErr_GivenExceptionMatches(__pyx_v_val, __pyx_t_3) != 0)) != 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_2)) { /* "cytoolz/itertoolz.pyx":675 * PyErr_Clear() * if not PyErr_GivenExceptionMatches(val, _get_list_exc): * raise val # <<<<<<<<<<<<<< * Py_INCREF(default) * PyTuple_SET_ITEM(result, i, default) */ __Pyx_Raise(__pyx_v_val, 0, 0, 0); __PYX_ERR(0, 675, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":674 * val = PyErr_Occurred() * PyErr_Clear() * if not PyErr_GivenExceptionMatches(val, _get_list_exc): # <<<<<<<<<<<<<< * raise val * Py_INCREF(default) */ } /* "cytoolz/itertoolz.pyx":676 * if not PyErr_GivenExceptionMatches(val, _get_list_exc): * raise val * Py_INCREF(default) # <<<<<<<<<<<<<< * PyTuple_SET_ITEM(result, i, default) * else: */ Py_INCREF(__pyx_v_default); /* "cytoolz/itertoolz.pyx":677 * raise val * Py_INCREF(default) * PyTuple_SET_ITEM(result, i, default) # <<<<<<<<<<<<<< * else: * val = obj */ PyTuple_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_default); /* "cytoolz/itertoolz.pyx":671 * for i, val in enumerate(ind): * obj = PtrObject_GetItem(seq, val) * if obj is NULL: # <<<<<<<<<<<<<< * val = PyErr_Occurred() * PyErr_Clear() */ goto __pyx_L9; } /* "cytoolz/itertoolz.pyx":679 * PyTuple_SET_ITEM(result, i, default) * else: * val = obj # <<<<<<<<<<<<<< * PyTuple_SET_ITEM(result, i, val) * return result */ /*else*/ { __pyx_t_3 = ((PyObject *)__pyx_v_obj); __Pyx_INCREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/itertoolz.pyx":680 * else: * val = obj * PyTuple_SET_ITEM(result, i, val) # <<<<<<<<<<<<<< * return result * */ PyTuple_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_val); } __pyx_L9:; /* "cytoolz/itertoolz.pyx":669 * * # List of indices with default * for i, val in enumerate(ind): # <<<<<<<<<<<<<< * obj = PtrObject_GetItem(seq, val) * if obj is NULL: */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/itertoolz.pyx":681 * val = obj * PyTuple_SET_ITEM(result, i, val) * return result # <<<<<<<<<<<<<< * * obj = PtrObject_GetItem(seq, ind) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":657 * cdef tuple result * cdef PyObject *obj * if isinstance(ind, list): # <<<<<<<<<<<<<< * i = PyList_GET_SIZE(ind) * result = PyTuple_New(i) */ } /* "cytoolz/itertoolz.pyx":683 * return result * * obj = PtrObject_GetItem(seq, ind) # <<<<<<<<<<<<<< * if obj is NULL: * val = PyErr_Occurred() */ __pyx_v_obj = PyObject_GetItem(__pyx_v_seq, __pyx_v_ind); /* "cytoolz/itertoolz.pyx":684 * * obj = PtrObject_GetItem(seq, ind) * if obj is NULL: # <<<<<<<<<<<<<< * val = PyErr_Occurred() * PyErr_Clear() */ __pyx_t_2 = ((__pyx_v_obj == NULL) != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":685 * obj = PtrObject_GetItem(seq, ind) * if obj is NULL: * val = PyErr_Occurred() # <<<<<<<<<<<<<< * PyErr_Clear() * if default == no_default: */ __pyx_t_8 = PyErr_Occurred(); __pyx_t_4 = ((PyObject *)__pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_v_val = __pyx_t_4; __pyx_t_4 = 0; /* "cytoolz/itertoolz.pyx":686 * if obj is NULL: * val = PyErr_Occurred() * PyErr_Clear() # <<<<<<<<<<<<<< * if default == no_default: * raise val */ PyErr_Clear(); /* "cytoolz/itertoolz.pyx":687 * val = PyErr_Occurred() * PyErr_Clear() * if default == no_default: # <<<<<<<<<<<<<< * raise val * if PyErr_GivenExceptionMatches(val, _get_exceptions): */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_no_default); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 687, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_v_default, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __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_ERR(0, 687, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_2)) { /* "cytoolz/itertoolz.pyx":688 * PyErr_Clear() * if default == no_default: * raise val # <<<<<<<<<<<<<< * if PyErr_GivenExceptionMatches(val, _get_exceptions): * return default */ __Pyx_Raise(__pyx_v_val, 0, 0, 0); __PYX_ERR(0, 688, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":687 * val = PyErr_Occurred() * PyErr_Clear() * if default == no_default: # <<<<<<<<<<<<<< * raise val * if PyErr_GivenExceptionMatches(val, _get_exceptions): */ } /* "cytoolz/itertoolz.pyx":689 * if default == no_default: * raise val * if PyErr_GivenExceptionMatches(val, _get_exceptions): # <<<<<<<<<<<<<< * return default * raise val */ __pyx_t_3 = __pyx_v_7cytoolz_9itertoolz__get_exceptions; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = (PyErr_GivenExceptionMatches(__pyx_v_val, __pyx_t_3) != 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":690 * raise val * if PyErr_GivenExceptionMatches(val, _get_exceptions): * return default # <<<<<<<<<<<<<< * raise val * val = obj */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_default); __pyx_r = __pyx_v_default; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":689 * if default == no_default: * raise val * if PyErr_GivenExceptionMatches(val, _get_exceptions): # <<<<<<<<<<<<<< * return default * raise val */ } /* "cytoolz/itertoolz.pyx":691 * if PyErr_GivenExceptionMatches(val, _get_exceptions): * return default * raise val # <<<<<<<<<<<<<< * val = obj * Py_XDECREF(obj) */ __Pyx_Raise(__pyx_v_val, 0, 0, 0); __PYX_ERR(0, 691, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":684 * * obj = PtrObject_GetItem(seq, ind) * if obj is NULL: # <<<<<<<<<<<<<< * val = PyErr_Occurred() * PyErr_Clear() */ } /* "cytoolz/itertoolz.pyx":692 * return default * raise val * val = obj # <<<<<<<<<<<<<< * Py_XDECREF(obj) * return val */ __pyx_t_3 = ((PyObject *)__pyx_v_obj); __Pyx_INCREF(__pyx_t_3); __pyx_v_val = __pyx_t_3; __pyx_t_3 = 0; /* "cytoolz/itertoolz.pyx":693 * raise val * val = obj * Py_XDECREF(obj) # <<<<<<<<<<<<<< * return val * */ Py_XDECREF(__pyx_v_obj); /* "cytoolz/itertoolz.pyx":694 * val = obj * Py_XDECREF(obj) * return val # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_val); __pyx_r = __pyx_v_val; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":619 * * * cpdef object get(object ind, object seq, object default='__no__default__'): # <<<<<<<<<<<<<< * """ * Get element in a sequence or dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("cytoolz.itertoolz.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_val); __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_31get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_30get[] = "get(ind, seq, default='__no__default__')\n\n Get element in a sequence or dict\n\n Provides standard indexing\n\n >>> get(1, 'ABC') # Same as 'ABC'[1]\n 'B'\n\n Pass a list to get multiple values\n\n >>> get([1, 2], 'ABC') # ('ABC'[1], 'ABC'[2])\n ('B', 'C')\n\n Works on any value that supports indexing/getitem\n For example here we see that it works with dictionaries\n\n >>> phonebook = {'Alice': '555-1234',\n ... 'Bob': '555-5678',\n ... 'Charlie':'555-9999'}\n >>> get('Alice', phonebook)\n '555-1234'\n\n >>> get(['Alice', 'Bob'], phonebook)\n ('555-1234', '555-5678')\n\n Provide a default for missing values\n\n >>> get(['Alice', 'Dennis'], phonebook, None)\n ('555-1234', None)\n\n See Also:\n pluck\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_31get = {"get", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9itertoolz_31get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9itertoolz_30get}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_31get(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ind = 0; PyObject *__pyx_v_seq = 0; PyObject *__pyx_v_default = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("get (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ind,&__pyx_n_s_seq,&__pyx_n_s_default,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)__pyx_n_s_no__default); 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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ind)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("get", 0, 2, 3, 1); __PYX_ERR(0, 619, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__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, "get") < 0)) __PYX_ERR(0, 619, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; 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_ind = values[0]; __pyx_v_seq = values[1]; __pyx_v_default = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("get", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 619, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_30get(__pyx_self, __pyx_v_ind, __pyx_v_seq, __pyx_v_default); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_30get(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seq, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_7cytoolz_9itertoolz_get __pyx_t_2; __Pyx_RefNannySetupContext("get", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.__pyx_default = __pyx_v_default; __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_get(__pyx_v_ind, __pyx_v_seq, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.get", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":697 * * * cpdef object concat(object seqs): # <<<<<<<<<<<<<< * """ * Concatenate zero or more iterables, any of which may be infinite. */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_33concat(PyObject *__pyx_self, PyObject *__pyx_v_seqs); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_concat(PyObject *__pyx_v_seqs, 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; __Pyx_RefNannySetupContext("concat", 0); /* "cytoolz/itertoolz.pyx":713 * itertools.chain.from_iterable equivalent * """ * return chain.from_iterable(seqs) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_chain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_from_iterable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_seqs) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_seqs); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 713, __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; /* "cytoolz/itertoolz.pyx":697 * * * cpdef object concat(object seqs): # <<<<<<<<<<<<<< * """ * Concatenate zero or more iterables, any of which may be infinite. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.itertoolz.concat", __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_7cytoolz_9itertoolz_33concat(PyObject *__pyx_self, PyObject *__pyx_v_seqs); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_32concat[] = "concat(seqs)\n\n Concatenate zero or more iterables, any of which may be infinite.\n\n An infinite sequence will prevent the rest of the arguments from\n being included.\n\n We use chain.from_iterable rather than ``chain(*seqs)`` so that seqs\n can be a generator.\n\n >>> list(concat([[], [1], [2, 3]]))\n [1, 2, 3]\n\n See also:\n itertools.chain.from_iterable equivalent\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_33concat = {"concat", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_33concat, METH_O, __pyx_doc_7cytoolz_9itertoolz_32concat}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_33concat(PyObject *__pyx_self, PyObject *__pyx_v_seqs) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("concat (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_32concat(__pyx_self, ((PyObject *)__pyx_v_seqs)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_32concat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seqs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("concat", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_concat(__pyx_v_seqs, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.concat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":716 * * * def concatv(*seqs): # <<<<<<<<<<<<<< * """ * Variadic version of concat */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_35concatv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_34concatv[] = "concatv(*seqs)\n\n Variadic version of concat\n\n >>> list(concatv([], [\"a\"], [\"b\", \"c\"]))\n ['a', 'b', 'c']\n\n See also:\n itertools.chain\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_35concatv = {"concatv", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9itertoolz_35concatv, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9itertoolz_34concatv}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_35concatv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_seqs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("concatv (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "concatv", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_seqs = __pyx_args; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_34concatv(__pyx_self, __pyx_v_seqs); /* function exit code */ __Pyx_XDECREF(__pyx_v_seqs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_34concatv(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seqs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("concatv", 0); /* "cytoolz/itertoolz.pyx":726 * itertools.chain * """ * return chain.from_iterable(seqs) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_chain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_from_iterable); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_seqs) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_seqs); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __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; /* "cytoolz/itertoolz.pyx":716 * * * def concatv(*seqs): # <<<<<<<<<<<<<< * """ * Variadic version of concat */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.itertoolz.concatv", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":729 * * * cpdef object mapcat(object func, object seqs): # <<<<<<<<<<<<<< * """ * Apply func to each sequence in seqs, concatenating results. */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_37mapcat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_mapcat(PyObject *__pyx_v_func, PyObject *__pyx_v_seqs, 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_t_4; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("mapcat", 0); /* "cytoolz/itertoolz.pyx":737 * ['A', 'B', 'C', 'D', 'E'] * """ * return concat(map(func, seqs)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_4 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_func, __pyx_v_seqs}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_func, __pyx_v_seqs}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL; } __Pyx_INCREF(__pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_func); __Pyx_INCREF(__pyx_v_seqs); __Pyx_GIVEREF(__pyx_v_seqs); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_seqs); __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __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_t_2 = __pyx_f_7cytoolz_9itertoolz_concat(__pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __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; /* "cytoolz/itertoolz.pyx":729 * * * cpdef object mapcat(object func, object seqs): # <<<<<<<<<<<<<< * """ * Apply func to each sequence in seqs, concatenating results. */ /* 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("cytoolz.itertoolz.mapcat", __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_7cytoolz_9itertoolz_37mapcat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_36mapcat[] = "mapcat(func, seqs)\n\n Apply func to each sequence in seqs, concatenating results.\n\n >>> list(mapcat(lambda s: [c.upper() for c in s],\n ... [[\"a\", \"b\"], [\"c\", \"d\", \"e\"]]))\n ['A', 'B', 'C', 'D', 'E']\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_37mapcat = {"mapcat", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9itertoolz_37mapcat, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9itertoolz_36mapcat}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_37mapcat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_func = 0; PyObject *__pyx_v_seqs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("mapcat (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_seqs,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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seqs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("mapcat", 1, 2, 2, 1); __PYX_ERR(0, 729, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mapcat") < 0)) __PYX_ERR(0, 729, __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_func = values[0]; __pyx_v_seqs = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("mapcat", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 729, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.mapcat", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_36mapcat(__pyx_self, __pyx_v_func, __pyx_v_seqs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_36mapcat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_seqs) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("mapcat", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_mapcat(__pyx_v_func, __pyx_v_seqs, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.mapcat", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":740 * * * cpdef object cons(object el, object seq): # <<<<<<<<<<<<<< * """ * Add el to beginning of (possibly infinite) sequence seq. */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_39cons(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_cons(PyObject *__pyx_v_el, PyObject *__pyx_v_seq, 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; __Pyx_RefNannySetupContext("cons", 0); /* "cytoolz/itertoolz.pyx":747 * [1, 2, 3] * """ * return chain((el,), seq) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_chain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_el); __Pyx_GIVEREF(__pyx_v_el); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_el); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_seq}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_seq}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 747, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_v_seq); __Pyx_GIVEREF(__pyx_v_seq); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_seq); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 747, __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_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":740 * * * cpdef object cons(object el, object seq): # <<<<<<<<<<<<<< * """ * Add el to beginning of (possibly infinite) sequence seq. */ /* 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_6); __Pyx_AddTraceback("cytoolz.itertoolz.cons", __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_7cytoolz_9itertoolz_39cons(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_38cons[] = "cons(el, seq)\n\n Add el to beginning of (possibly infinite) sequence seq.\n\n >>> list(cons(1, [2, 3]))\n [1, 2, 3]\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_39cons = {"cons", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9itertoolz_39cons, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9itertoolz_38cons}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_39cons(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_el = 0; PyObject *__pyx_v_seq = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("cons (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_el,&__pyx_n_s_seq,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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_el)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("cons", 1, 2, 2, 1); __PYX_ERR(0, 740, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cons") < 0)) __PYX_ERR(0, 740, __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_el = values[0]; __pyx_v_seq = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("cons", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 740, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.cons", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_38cons(__pyx_self, __pyx_v_el, __pyx_v_seq); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_38cons(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_el, PyObject *__pyx_v_seq) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("cons", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_cons(__pyx_v_el, __pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.cons", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":758 * [1, 'a', 2, 'a', 3] * """ * def __cinit__(self, object el, object seq): # <<<<<<<<<<<<<< * self.el = el * self.iter_seq = iter(seq) */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9itertoolz_9interpose_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9itertoolz_9interpose_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_el = 0; PyObject *__pyx_v_seq = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_el,&__pyx_n_s_seq,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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_el)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 758, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 758, __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_el = values[0]; __pyx_v_seq = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 758, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.interpose.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_9interpose___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz_interpose *)__pyx_v_self), __pyx_v_el, __pyx_v_seq); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9itertoolz_9interpose___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_interpose *__pyx_v_self, PyObject *__pyx_v_el, PyObject *__pyx_v_seq) { 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_t_6; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/itertoolz.pyx":759 * """ * def __cinit__(self, object el, object seq): * self.el = el # <<<<<<<<<<<<<< * self.iter_seq = iter(seq) * self.do_el = False */ __Pyx_INCREF(__pyx_v_el); __Pyx_GIVEREF(__pyx_v_el); __Pyx_GOTREF(__pyx_v_self->el); __Pyx_DECREF(__pyx_v_self->el); __pyx_v_self->el = __pyx_v_el; /* "cytoolz/itertoolz.pyx":760 * def __cinit__(self, object el, object seq): * self.el = el * self.iter_seq = iter(seq) # <<<<<<<<<<<<<< * self.do_el = False * try: */ __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->iter_seq); __Pyx_DECREF(__pyx_v_self->iter_seq); __pyx_v_self->iter_seq = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":761 * self.el = el * self.iter_seq = iter(seq) * self.do_el = False # <<<<<<<<<<<<<< * try: * self.val = next(self.iter_seq) */ __pyx_v_self->do_el = 0; /* "cytoolz/itertoolz.pyx":762 * self.iter_seq = iter(seq) * self.do_el = False * try: # <<<<<<<<<<<<<< * self.val = next(self.iter_seq) * except StopIteration: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __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:*/ { /* "cytoolz/itertoolz.pyx":763 * self.do_el = False * try: * self.val = next(self.iter_seq) # <<<<<<<<<<<<<< * except StopIteration: * self.do_el = True */ __pyx_t_1 = __pyx_v_self->iter_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->val); __Pyx_DECREF(__pyx_v_self->val); __pyx_v_self->val = __pyx_t_5; __pyx_t_5 = 0; /* "cytoolz/itertoolz.pyx":762 * self.iter_seq = iter(seq) * self.do_el = False * try: # <<<<<<<<<<<<<< * self.val = next(self.iter_seq) * except StopIteration: */ } __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_L8_try_end; __pyx_L3_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "cytoolz/itertoolz.pyx":764 * try: * self.val = next(self.iter_seq) * except StopIteration: # <<<<<<<<<<<<<< * self.do_el = True * */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_6) { __Pyx_AddTraceback("cytoolz.itertoolz.interpose.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_7) < 0) __PYX_ERR(0, 764, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_7); /* "cytoolz/itertoolz.pyx":765 * self.val = next(self.iter_seq) * except StopIteration: * self.do_el = True # <<<<<<<<<<<<<< * * def __iter__(self): */ __pyx_v_self->do_el = 1; __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; goto __pyx_L4_exception_handled; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "cytoolz/itertoolz.pyx":762 * self.iter_seq = iter(seq) * self.do_el = False * try: # <<<<<<<<<<<<<< * self.val = next(self.iter_seq) * except StopIteration: */ __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_L8_try_end:; } /* "cytoolz/itertoolz.pyx":758 * [1, 'a', 2, 'a', 3] * """ * def __cinit__(self, object el, object seq): # <<<<<<<<<<<<<< * self.el = el * self.iter_seq = iter(seq) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("cytoolz.itertoolz.interpose.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":767 * self.do_el = True * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_9interpose_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_9interpose_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_9interpose_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz_interpose *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_9interpose_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_interpose *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* "cytoolz/itertoolz.pyx":768 * * 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; /* "cytoolz/itertoolz.pyx":767 * self.do_el = True * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":770 * return self * * def __next__(self): # <<<<<<<<<<<<<< * if self.do_el: * self.val = next(self.iter_seq) */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_9interpose_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_9interpose_5__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_9interpose_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz_interpose *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_9interpose_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_interpose *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":771 * * def __next__(self): * if self.do_el: # <<<<<<<<<<<<<< * self.val = next(self.iter_seq) * self.do_el = False */ __pyx_t_1 = (__pyx_v_self->do_el != 0); if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":772 * def __next__(self): * if self.do_el: * self.val = next(self.iter_seq) # <<<<<<<<<<<<<< * self.do_el = False * return self.el */ __pyx_t_2 = __pyx_v_self->iter_seq; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->val); __Pyx_DECREF(__pyx_v_self->val); __pyx_v_self->val = __pyx_t_3; __pyx_t_3 = 0; /* "cytoolz/itertoolz.pyx":773 * if self.do_el: * self.val = next(self.iter_seq) * self.do_el = False # <<<<<<<<<<<<<< * return self.el * else: */ __pyx_v_self->do_el = 0; /* "cytoolz/itertoolz.pyx":774 * self.val = next(self.iter_seq) * self.do_el = False * return self.el # <<<<<<<<<<<<<< * else: * self.do_el = True */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->el); __pyx_r = __pyx_v_self->el; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":771 * * def __next__(self): * if self.do_el: # <<<<<<<<<<<<<< * self.val = next(self.iter_seq) * self.do_el = False */ } /* "cytoolz/itertoolz.pyx":776 * return self.el * else: * self.do_el = True # <<<<<<<<<<<<<< * return self.val * */ /*else*/ { __pyx_v_self->do_el = 1; /* "cytoolz/itertoolz.pyx":777 * else: * self.do_el = True * return self.val # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->val); __pyx_r = __pyx_v_self->val; goto __pyx_L0; } /* "cytoolz/itertoolz.pyx":770 * return self * * def __next__(self): # <<<<<<<<<<<<<< * if self.do_el: * self.val = next(self.iter_seq) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.itertoolz.interpose.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_9interpose_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_9interpose_6__reduce_cython__[] = "interpose.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_9interpose_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_9interpose_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_9interpose_6__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_9interpose_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_9interpose_6__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz_interpose *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_9interpose_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_interpose *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz.interpose.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_9interpose_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_9interpose_8__setstate_cython__[] = "interpose.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_9interpose_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_9interpose_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_9interpose_8__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_9interpose_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_9interpose_8__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz_interpose *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_9interpose_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_interpose *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz.interpose.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":780 * * * cpdef dict frequencies(object seq): # <<<<<<<<<<<<<< * """ * Find number of occurrences of each value in seq */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_41frequencies(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_frequencies(PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_v_d = 0; PyObject *__pyx_v_obj; Py_ssize_t __pyx_v_val; PyObject *__pyx_v_item = NULL; 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; int __pyx_t_5; Py_ssize_t __pyx_t_6; __Pyx_RefNannySetupContext("frequencies", 0); /* "cytoolz/itertoolz.pyx":791 * groupby * """ * cdef dict d = {} # <<<<<<<<<<<<<< * cdef PyObject *obj * cdef Py_ssize_t val */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_d = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":794 * cdef PyObject *obj * cdef Py_ssize_t val * for item in seq: # <<<<<<<<<<<<<< * obj = PyDict_GetItem(d, item) * if obj is NULL: */ if (likely(PyList_CheckExact(__pyx_v_seq)) || PyTuple_CheckExact(__pyx_v_seq)) { __pyx_t_1 = __pyx_v_seq; __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_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 794, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 794, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 794, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 794, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/itertoolz.pyx":795 * cdef Py_ssize_t val * for item in seq: * obj = PyDict_GetItem(d, item) # <<<<<<<<<<<<<< * if obj is NULL: * d[item] = 1 */ __pyx_v_obj = PyDict_GetItem(__pyx_v_d, __pyx_v_item); /* "cytoolz/itertoolz.pyx":796 * for item in seq: * obj = PyDict_GetItem(d, item) * if obj is NULL: # <<<<<<<<<<<<<< * d[item] = 1 * else: */ __pyx_t_5 = ((__pyx_v_obj == NULL) != 0); if (__pyx_t_5) { /* "cytoolz/itertoolz.pyx":797 * obj = PyDict_GetItem(d, item) * if obj is NULL: * d[item] = 1 # <<<<<<<<<<<<<< * else: * val = obj */ if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_v_item, __pyx_int_1) < 0)) __PYX_ERR(0, 797, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":796 * for item in seq: * obj = PyDict_GetItem(d, item) * if obj is NULL: # <<<<<<<<<<<<<< * d[item] = 1 * else: */ goto __pyx_L5; } /* "cytoolz/itertoolz.pyx":799 * d[item] = 1 * else: * val = obj # <<<<<<<<<<<<<< * d[item] = val + 1 * return d */ /*else*/ { __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(((PyObject *)__pyx_v_obj)); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 799, __pyx_L1_error) __pyx_v_val = __pyx_t_6; /* "cytoolz/itertoolz.pyx":800 * else: * val = obj * d[item] = val + 1 # <<<<<<<<<<<<<< * return d * */ __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_val + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (unlikely(PyDict_SetItem(__pyx_v_d, __pyx_v_item, __pyx_t_4) < 0)) __PYX_ERR(0, 800, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L5:; /* "cytoolz/itertoolz.pyx":794 * cdef PyObject *obj * cdef Py_ssize_t val * for item in seq: # <<<<<<<<<<<<<< * obj = PyDict_GetItem(d, item) * if obj is NULL: */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":801 * val = obj * d[item] = val + 1 * return d # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_d); __pyx_r = __pyx_v_d; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":780 * * * cpdef dict frequencies(object seq): # <<<<<<<<<<<<<< * """ * Find number of occurrences of each value in seq */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("cytoolz.itertoolz.frequencies", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_d); __Pyx_XDECREF(__pyx_v_item); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_41frequencies(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_40frequencies[] = "frequencies(seq) -> dict\n\n Find number of occurrences of each value in seq\n\n >>> frequencies(['cat', 'cat', 'ox', 'pig', 'pig', 'cat']) #doctest: +SKIP\n {'cat': 3, 'ox': 1, 'pig': 2}\n\n See Also:\n countby\n groupby\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_41frequencies = {"frequencies", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_41frequencies, METH_O, __pyx_doc_7cytoolz_9itertoolz_40frequencies}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_41frequencies(PyObject *__pyx_self, PyObject *__pyx_v_seq) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("frequencies (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_40frequencies(__pyx_self, ((PyObject *)__pyx_v_seq)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_40frequencies(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("frequencies", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_frequencies(__pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.frequencies", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":804 * * * cdef inline object _reduceby_core(dict d, object key, object item, object binop, # <<<<<<<<<<<<<< * object init, bint skip_init, bint call_init): * cdef PyObject *obj = PyDict_GetItem(d, key) */ static CYTHON_INLINE PyObject *__pyx_f_7cytoolz_9itertoolz__reduceby_core(PyObject *__pyx_v_d, PyObject *__pyx_v_key, PyObject *__pyx_v_item, PyObject *__pyx_v_binop, PyObject *__pyx_v_init, int __pyx_v_skip_init, int __pyx_v_call_init) { PyObject *__pyx_v_obj; 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; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("_reduceby_core", 0); /* "cytoolz/itertoolz.pyx":806 * cdef inline object _reduceby_core(dict d, object key, object item, object binop, * object init, bint skip_init, bint call_init): * cdef PyObject *obj = PyDict_GetItem(d, key) # <<<<<<<<<<<<<< * if obj is not NULL: * PyDict_SetItem(d, key, binop(obj, item)) */ __pyx_v_obj = PyDict_GetItem(__pyx_v_d, __pyx_v_key); /* "cytoolz/itertoolz.pyx":807 * object init, bint skip_init, bint call_init): * cdef PyObject *obj = PyDict_GetItem(d, key) * if obj is not NULL: # <<<<<<<<<<<<<< * PyDict_SetItem(d, key, binop(obj, item)) * elif skip_init: */ __pyx_t_1 = ((__pyx_v_obj != NULL) != 0); if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":808 * cdef PyObject *obj = PyDict_GetItem(d, key) * if obj is not NULL: * PyDict_SetItem(d, key, binop(obj, item)) # <<<<<<<<<<<<<< * elif skip_init: * PyDict_SetItem(d, key, item) */ __Pyx_INCREF(__pyx_v_binop); __pyx_t_3 = __pyx_v_binop; __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_obj), __pyx_v_item}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_obj), __pyx_v_item}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_INCREF(((PyObject *)__pyx_v_obj)); __Pyx_GIVEREF(((PyObject *)__pyx_v_obj)); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_obj)); __Pyx_INCREF(__pyx_v_item); __Pyx_GIVEREF(__pyx_v_item); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_item); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __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_t_5 = PyDict_SetItem(__pyx_v_d, __pyx_v_key, __pyx_t_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 808, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":807 * object init, bint skip_init, bint call_init): * cdef PyObject *obj = PyDict_GetItem(d, key) * if obj is not NULL: # <<<<<<<<<<<<<< * PyDict_SetItem(d, key, binop(obj, item)) * elif skip_init: */ goto __pyx_L3; } /* "cytoolz/itertoolz.pyx":809 * if obj is not NULL: * PyDict_SetItem(d, key, binop(obj, item)) * elif skip_init: # <<<<<<<<<<<<<< * PyDict_SetItem(d, key, item) * elif call_init: */ __pyx_t_1 = (__pyx_v_skip_init != 0); if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":810 * PyDict_SetItem(d, key, binop(obj, item)) * elif skip_init: * PyDict_SetItem(d, key, item) # <<<<<<<<<<<<<< * elif call_init: * PyDict_SetItem(d, key, binop(init(), item)) */ __pyx_t_5 = PyDict_SetItem(__pyx_v_d, __pyx_v_key, __pyx_v_item); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 810, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":809 * if obj is not NULL: * PyDict_SetItem(d, key, binop(obj, item)) * elif skip_init: # <<<<<<<<<<<<<< * PyDict_SetItem(d, key, item) * elif call_init: */ goto __pyx_L3; } /* "cytoolz/itertoolz.pyx":811 * elif skip_init: * PyDict_SetItem(d, key, item) * elif call_init: # <<<<<<<<<<<<<< * PyDict_SetItem(d, key, binop(init(), item)) * else: */ __pyx_t_1 = (__pyx_v_call_init != 0); if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":812 * PyDict_SetItem(d, key, item) * elif call_init: * PyDict_SetItem(d, key, binop(init(), item)) # <<<<<<<<<<<<<< * else: * PyDict_SetItem(d, key, binop(init, item)) */ __Pyx_INCREF(__pyx_v_init); __pyx_t_6 = __pyx_v_init; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_INCREF(__pyx_v_binop); __pyx_t_6 = __pyx_v_binop; __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_item}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_item}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_v_item); __Pyx_GIVEREF(__pyx_v_item); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_5, __pyx_v_item); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = PyDict_SetItem(__pyx_v_d, __pyx_v_key, __pyx_t_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 812, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":811 * elif skip_init: * PyDict_SetItem(d, key, item) * elif call_init: # <<<<<<<<<<<<<< * PyDict_SetItem(d, key, binop(init(), item)) * else: */ goto __pyx_L3; } /* "cytoolz/itertoolz.pyx":814 * PyDict_SetItem(d, key, binop(init(), item)) * else: * PyDict_SetItem(d, key, binop(init, item)) # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_INCREF(__pyx_v_binop); __pyx_t_6 = __pyx_v_binop; __pyx_t_7 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_6, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_init, __pyx_v_item}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_init, __pyx_v_item}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); } else #endif { __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_v_init); __Pyx_GIVEREF(__pyx_v_init); PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_init); __Pyx_INCREF(__pyx_v_item); __Pyx_GIVEREF(__pyx_v_item); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_item); __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 814, __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_5 = PyDict_SetItem(__pyx_v_d, __pyx_v_key, __pyx_t_2); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 814, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L3:; /* "cytoolz/itertoolz.pyx":804 * * * cdef inline object _reduceby_core(dict d, object key, object item, object binop, # <<<<<<<<<<<<<< * object init, bint skip_init, bint call_init): * cdef PyObject *obj = PyDict_GetItem(d, key) */ /* 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_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("cytoolz.itertoolz._reduceby_core", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":817 * * * cpdef dict reduceby(object key, object binop, object seq, object init='__no__default__'): # <<<<<<<<<<<<<< * """ * Perform a simultaneous groupby and reduction */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_43reduceby(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_reduceby(PyObject *__pyx_v_key, PyObject *__pyx_v_binop, PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_reduceby *__pyx_optional_args) { PyObject *__pyx_v_init = ((PyObject *)__pyx_n_s_no__default); PyObject *__pyx_v_d = 0; PyObject *__pyx_v_item = 0; PyObject *__pyx_v_keyval = 0; Py_ssize_t __pyx_v_i; Py_ssize_t __pyx_v_N; int __pyx_v_skip_init; int __pyx_v_call_init; PyObject *__pyx_v_val = 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; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); 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; PyObject *__pyx_t_12; __Pyx_RefNannySetupContext("reduceby", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_init = __pyx_optional_args->init; } } /* "cytoolz/itertoolz.pyx":879 * False: set([1, 3])} * """ * cdef dict d = {} # <<<<<<<<<<<<<< * cdef object item, keyval * cdef Py_ssize_t i, N */ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_d = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":882 * cdef object item, keyval * cdef Py_ssize_t i, N * cdef bint skip_init = init == no_default # <<<<<<<<<<<<<< * cdef bint call_init = callable(init) * if callable(key): */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_no_default); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_RichCompare(__pyx_v_init, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __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_ERR(0, 882, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_skip_init = __pyx_t_3; /* "cytoolz/itertoolz.pyx":883 * cdef Py_ssize_t i, N * cdef bint skip_init = init == no_default * cdef bint call_init = callable(init) # <<<<<<<<<<<<<< * if callable(key): * for item in seq: */ __pyx_t_3 = __Pyx_PyCallable_Check(__pyx_v_init); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 883, __pyx_L1_error) __pyx_v_call_init = __pyx_t_3; /* "cytoolz/itertoolz.pyx":884 * cdef bint skip_init = init == no_default * cdef bint call_init = callable(init) * if callable(key): # <<<<<<<<<<<<<< * for item in seq: * keyval = key(item) */ __pyx_t_3 = __Pyx_PyCallable_Check(__pyx_v_key); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 884, __pyx_L1_error) __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { /* "cytoolz/itertoolz.pyx":885 * cdef bint call_init = callable(init) * if callable(key): * for item in seq: # <<<<<<<<<<<<<< * keyval = key(item) * _reduceby_core(d, keyval, item, binop, init, skip_init, call_init) */ if (likely(PyList_CheckExact(__pyx_v_seq)) || PyTuple_CheckExact(__pyx_v_seq)) { __pyx_t_2 = __pyx_v_seq; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 885, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 885, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 885, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 885, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":886 * if callable(key): * for item in seq: * keyval = key(item) # <<<<<<<<<<<<<< * _reduceby_core(d, keyval, item, binop, init, skip_init, call_init) * elif isinstance(key, list): */ __Pyx_INCREF(__pyx_v_key); __pyx_t_7 = __pyx_v_key; __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_item); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_keyval, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":887 * for item in seq: * keyval = key(item) * _reduceby_core(d, keyval, item, binop, init, skip_init, call_init) # <<<<<<<<<<<<<< * elif isinstance(key, list): * N = PyList_GET_SIZE(key) */ __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz__reduceby_core(__pyx_v_d, __pyx_v_keyval, __pyx_v_item, __pyx_v_binop, __pyx_v_init, __pyx_v_skip_init, __pyx_v_call_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":885 * cdef bint call_init = callable(init) * if callable(key): * for item in seq: # <<<<<<<<<<<<<< * keyval = key(item) * _reduceby_core(d, keyval, item, binop, init, skip_init, call_init) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":884 * cdef bint skip_init = init == no_default * cdef bint call_init = callable(init) * if callable(key): # <<<<<<<<<<<<<< * for item in seq: * keyval = key(item) */ goto __pyx_L3; } /* "cytoolz/itertoolz.pyx":888 * keyval = key(item) * _reduceby_core(d, keyval, item, binop, init, skip_init, call_init) * elif isinstance(key, list): # <<<<<<<<<<<<<< * N = PyList_GET_SIZE(key) * for item in seq: */ __pyx_t_4 = PyList_Check(__pyx_v_key); __pyx_t_3 = (__pyx_t_4 != 0); if (__pyx_t_3) { /* "cytoolz/itertoolz.pyx":889 * _reduceby_core(d, keyval, item, binop, init, skip_init, call_init) * elif isinstance(key, list): * N = PyList_GET_SIZE(key) # <<<<<<<<<<<<<< * for item in seq: * keyval = PyTuple_New(N) */ __pyx_v_N = PyList_GET_SIZE(__pyx_v_key); /* "cytoolz/itertoolz.pyx":890 * elif isinstance(key, list): * N = PyList_GET_SIZE(key) * for item in seq: # <<<<<<<<<<<<<< * keyval = PyTuple_New(N) * for i in range(N): */ if (likely(PyList_CheckExact(__pyx_v_seq)) || PyTuple_CheckExact(__pyx_v_seq)) { __pyx_t_2 = __pyx_v_seq; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 890, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 890, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 890, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 890, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":891 * N = PyList_GET_SIZE(key) * for item in seq: * keyval = PyTuple_New(N) # <<<<<<<<<<<<<< * for i in range(N): * val = PyList_GET_ITEM(key, i) */ __pyx_t_1 = PyTuple_New(__pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_keyval, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":892 * for item in seq: * keyval = PyTuple_New(N) * for i in range(N): # <<<<<<<<<<<<<< * val = PyList_GET_ITEM(key, i) * val = item[val] */ __pyx_t_9 = __pyx_v_N; __pyx_t_10 = __pyx_t_9; for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11; /* "cytoolz/itertoolz.pyx":893 * keyval = PyTuple_New(N) * for i in range(N): * val = PyList_GET_ITEM(key, i) # <<<<<<<<<<<<<< * val = item[val] * Py_INCREF(val) */ __pyx_t_12 = PyList_GET_ITEM(__pyx_v_key, __pyx_v_i); __pyx_t_1 = ((PyObject *)__pyx_t_12); __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":894 * for i in range(N): * val = PyList_GET_ITEM(key, i) * val = item[val] # <<<<<<<<<<<<<< * Py_INCREF(val) * PyTuple_SET_ITEM(keyval, i, val) */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_item, __pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 894, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":895 * val = PyList_GET_ITEM(key, i) * val = item[val] * Py_INCREF(val) # <<<<<<<<<<<<<< * PyTuple_SET_ITEM(keyval, i, val) * _reduceby_core(d, keyval, item, binop, init, skip_init, call_init) */ Py_INCREF(__pyx_v_val); /* "cytoolz/itertoolz.pyx":896 * val = item[val] * Py_INCREF(val) * PyTuple_SET_ITEM(keyval, i, val) # <<<<<<<<<<<<<< * _reduceby_core(d, keyval, item, binop, init, skip_init, call_init) * else: */ PyTuple_SET_ITEM(__pyx_v_keyval, __pyx_v_i, __pyx_v_val); } /* "cytoolz/itertoolz.pyx":897 * Py_INCREF(val) * PyTuple_SET_ITEM(keyval, i, val) * _reduceby_core(d, keyval, item, binop, init, skip_init, call_init) # <<<<<<<<<<<<<< * else: * for item in seq: */ __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz__reduceby_core(__pyx_v_d, __pyx_v_keyval, __pyx_v_item, __pyx_v_binop, __pyx_v_init, __pyx_v_skip_init, __pyx_v_call_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":890 * elif isinstance(key, list): * N = PyList_GET_SIZE(key) * for item in seq: # <<<<<<<<<<<<<< * keyval = PyTuple_New(N) * for i in range(N): */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":888 * keyval = key(item) * _reduceby_core(d, keyval, item, binop, init, skip_init, call_init) * elif isinstance(key, list): # <<<<<<<<<<<<<< * N = PyList_GET_SIZE(key) * for item in seq: */ goto __pyx_L3; } /* "cytoolz/itertoolz.pyx":899 * _reduceby_core(d, keyval, item, binop, init, skip_init, call_init) * else: * for item in seq: # <<<<<<<<<<<<<< * keyval = item[key] * _reduceby_core(d, keyval, item, binop, init, skip_init, call_init) */ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_seq)) || PyTuple_CheckExact(__pyx_v_seq)) { __pyx_t_2 = __pyx_v_seq; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 899, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 899, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 899, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 899, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":900 * else: * for item in seq: * keyval = item[key] # <<<<<<<<<<<<<< * _reduceby_core(d, keyval, item, binop, init, skip_init, call_init) * return d */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_item, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_keyval, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":901 * for item in seq: * keyval = item[key] * _reduceby_core(d, keyval, item, binop, init, skip_init, call_init) # <<<<<<<<<<<<<< * return d * */ __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz__reduceby_core(__pyx_v_d, __pyx_v_keyval, __pyx_v_item, __pyx_v_binop, __pyx_v_init, __pyx_v_skip_init, __pyx_v_call_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":899 * _reduceby_core(d, keyval, item, binop, init, skip_init, call_init) * else: * for item in seq: # <<<<<<<<<<<<<< * keyval = item[key] * _reduceby_core(d, keyval, item, binop, init, skip_init, call_init) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L3:; /* "cytoolz/itertoolz.pyx":902 * keyval = item[key] * _reduceby_core(d, keyval, item, binop, init, skip_init, call_init) * return d # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_d); __pyx_r = __pyx_v_d; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":817 * * * cpdef dict reduceby(object key, object binop, object seq, object init='__no__default__'): # <<<<<<<<<<<<<< * """ * Perform a simultaneous groupby and reduction */ /* 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); __Pyx_AddTraceback("cytoolz.itertoolz.reduceby", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_d); __Pyx_XDECREF(__pyx_v_item); __Pyx_XDECREF(__pyx_v_keyval); __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_43reduceby(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_42reduceby[] = "reduceby(key, binop, seq, init='__no__default__') -> dict\n\n Perform a simultaneous groupby and reduction\n\n The computation:\n\n >>> result = reduceby(key, binop, seq, init) # doctest: +SKIP\n\n is equivalent to the following:\n\n >>> def reduction(group): # doctest: +SKIP\n ... return reduce(binop, group, init) # doctest: +SKIP\n\n >>> groups = groupby(key, seq) # doctest: +SKIP\n >>> result = valmap(reduction, groups) # doctest: +SKIP\n\n But the former does not build the intermediate groups, allowing it to\n operate in much less space. This makes it suitable for larger datasets\n that do not fit comfortably in memory\n\n The ``init`` keyword argument is the default initialization of the\n reduction. This can be either a constant value like ``0`` or a callable\n like ``lambda : 0`` as might be used in ``defaultdict``.\n\n Simple Examples\n ---------------\n\n >>> from operator import add, mul\n >>> iseven = lambda x: x % 2 == 0\n\n >>> data = [1, 2, 3, 4, 5]\n\n >>> reduceby(iseven, add, data) # doctest: +SKIP\n {False: 9, True: 6}\n\n >>> reduceby(iseven, mul, data) # doctest: +SKIP\n {False: 15, True: 8}\n\n Complex Example\n ---------------\n\n >>> projects = [{'name': 'build roads', 'state': 'CA', 'cost': 1000000},\n ... {'name': 'fight crime', 'state': 'IL', 'cost': 100000},\n ... {'name': 'help farmers', 'state': 'IL', 'cost': 2000000},\n ... {'name': 'help farmers', 'state': 'CA', 'cost': 200000}]\n\n >>> reduceby('state', # doctest: +SKIP\n ... lambda acc, x: acc + x['cost'],\n ... projects, 0)\n {'CA': 1200000, 'IL': 2100000}\n\n Example Using ``init``\n ----------------------\n\n >>> def set_add(s, i):\n ... s.add(i)\n ... return s\n\n >>> reduceby(iseven, set_add, [1, 2, 3"", 4, 1, 2, 3], set) # doctest: +SKIP\n {True: set([2, 4]),\n False: set([1, 3])}\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_43reduceby = {"reduceby", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9itertoolz_43reduceby, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9itertoolz_42reduceby}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_43reduceby(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_binop = 0; PyObject *__pyx_v_seq = 0; PyObject *__pyx_v_init = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("reduceby (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_binop,&__pyx_n_s_seq,&__pyx_n_s_init,0}; PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)__pyx_n_s_no__default); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args; const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); switch (pos_args) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_binop)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("reduceby", 0, 3, 4, 1); __PYX_ERR(0, 817, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("reduceby", 0, 3, 4, 2); __PYX_ERR(0, 817, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_init); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reduceby") < 0)) __PYX_ERR(0, 817, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; 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_key = values[0]; __pyx_v_binop = values[1]; __pyx_v_seq = values[2]; __pyx_v_init = values[3]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("reduceby", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 817, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.reduceby", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_42reduceby(__pyx_self, __pyx_v_key, __pyx_v_binop, __pyx_v_seq, __pyx_v_init); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_42reduceby(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_binop, PyObject *__pyx_v_seq, PyObject *__pyx_v_init) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_7cytoolz_9itertoolz_reduceby __pyx_t_2; __Pyx_RefNannySetupContext("reduceby", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.init = __pyx_v_init; __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_reduceby(__pyx_v_key, __pyx_v_binop, __pyx_v_seq, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.reduceby", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":932 * 8 * """ * def __cinit__(self, object func, object x): # <<<<<<<<<<<<<< * self.func = func * self.x = x */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9itertoolz_7iterate_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9itertoolz_7iterate_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_func = 0; PyObject *__pyx_v_x = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_x,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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 932, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 932, __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_func = values[0]; __pyx_v_x = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 932, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.iterate.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_7iterate___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz_iterate *)__pyx_v_self), __pyx_v_func, __pyx_v_x); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9itertoolz_7iterate___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_iterate *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_x) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/itertoolz.pyx":933 * """ * def __cinit__(self, object func, object x): * self.func = func # <<<<<<<<<<<<<< * self.x = x * self.val = self # sentinel */ __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; /* "cytoolz/itertoolz.pyx":934 * def __cinit__(self, object func, object x): * self.func = func * self.x = x # <<<<<<<<<<<<<< * self.val = self # sentinel * */ __Pyx_INCREF(__pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); __Pyx_GOTREF(__pyx_v_self->x); __Pyx_DECREF(__pyx_v_self->x); __pyx_v_self->x = __pyx_v_x; /* "cytoolz/itertoolz.pyx":935 * self.func = func * self.x = x * self.val = self # sentinel # <<<<<<<<<<<<<< * * def __iter__(self): */ __Pyx_INCREF(((PyObject *)__pyx_v_self)); __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); __Pyx_GOTREF(__pyx_v_self->val); __Pyx_DECREF(__pyx_v_self->val); __pyx_v_self->val = ((PyObject *)__pyx_v_self); /* "cytoolz/itertoolz.pyx":932 * 8 * """ * def __cinit__(self, object func, object x): # <<<<<<<<<<<<<< * self.func = func * self.x = x */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":937 * self.val = self # sentinel * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_7iterate_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_7iterate_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_7iterate_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz_iterate *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_7iterate_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_iterate *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* "cytoolz/itertoolz.pyx":938 * * 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; /* "cytoolz/itertoolz.pyx":937 * self.val = self # sentinel * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":940 * return self * * def __next__(self): # <<<<<<<<<<<<<< * if self.val is self: * self.val = self.x */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_7iterate_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_7iterate_5__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_7iterate_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz_iterate *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_7iterate_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_iterate *__pyx_v_self) { 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; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":941 * * def __next__(self): * if self.val is self: # <<<<<<<<<<<<<< * self.val = self.x * else: */ __pyx_t_1 = (__pyx_v_self->val == ((PyObject *)__pyx_v_self)); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":942 * def __next__(self): * if self.val is self: * self.val = self.x # <<<<<<<<<<<<<< * else: * self.x = self.func(self.x) */ __pyx_t_3 = __pyx_v_self->x; __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->val); __Pyx_DECREF(__pyx_v_self->val); __pyx_v_self->val = __pyx_t_3; __pyx_t_3 = 0; /* "cytoolz/itertoolz.pyx":941 * * def __next__(self): * if self.val is self: # <<<<<<<<<<<<<< * self.val = self.x * else: */ goto __pyx_L3; } /* "cytoolz/itertoolz.pyx":944 * self.val = self.x * else: * self.x = self.func(self.x) # <<<<<<<<<<<<<< * return self.x * */ /*else*/ { __Pyx_INCREF(__pyx_v_self->func); __pyx_t_4 = __pyx_v_self->func; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_self->x) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self->x); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 944, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->x); __Pyx_DECREF(__pyx_v_self->x); __pyx_v_self->x = __pyx_t_3; __pyx_t_3 = 0; } __pyx_L3:; /* "cytoolz/itertoolz.pyx":945 * else: * self.x = self.func(self.x) * return self.x # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->x); __pyx_r = __pyx_v_self->x; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":940 * return self * * def __next__(self): # <<<<<<<<<<<<<< * if self.val is self: * self.val = self.x */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("cytoolz.itertoolz.iterate.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_7iterate_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_7iterate_6__reduce_cython__[] = "iterate.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_7iterate_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_7iterate_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_7iterate_6__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_7iterate_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_7iterate_6__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz_iterate *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_7iterate_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_iterate *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz.iterate.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_7iterate_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_7iterate_8__setstate_cython__[] = "iterate.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_7iterate_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_7iterate_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_7iterate_8__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_7iterate_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_7iterate_8__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz_iterate *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_7iterate_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_iterate *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz.iterate.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":963 * [1.5, 2.5, 3.5] * """ * def __cinit__(self, Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * cdef Py_ssize_t i * self.iterseq = iter(seq) */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9itertoolz_14sliding_window_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9itertoolz_14sliding_window_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { Py_ssize_t __pyx_v_n; PyObject *__pyx_v_seq = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_seq,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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 963, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 963, __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_n = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_n == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 963, __pyx_L3_error) __pyx_v_seq = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 963, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.sliding_window.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_14sliding_window___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *)__pyx_v_self), __pyx_v_n, __pyx_v_seq); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9itertoolz_14sliding_window___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *__pyx_v_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq) { Py_ssize_t __pyx_v_i; int __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; PyObject *__pyx_t_7 = NULL; Py_ssize_t __pyx_t_8; PyObject *(*__pyx_t_9)(PyObject *); __Pyx_RefNannySetupContext("__cinit__", 0); __Pyx_INCREF(__pyx_v_seq); /* "cytoolz/itertoolz.pyx":965 * def __cinit__(self, Py_ssize_t n, object seq): * cdef Py_ssize_t i * self.iterseq = iter(seq) # <<<<<<<<<<<<<< * self.prev = PyTuple_New(n) * for i, seq in enumerate(islice(self.iterseq, n-1), 1): */ __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->iterseq); __Pyx_DECREF(__pyx_v_self->iterseq); __pyx_v_self->iterseq = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":966 * cdef Py_ssize_t i * self.iterseq = iter(seq) * self.prev = PyTuple_New(n) # <<<<<<<<<<<<<< * for i, seq in enumerate(islice(self.iterseq, n-1), 1): * Py_INCREF(seq) */ __pyx_t_1 = PyTuple_New(__pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->prev); __Pyx_DECREF(__pyx_v_self->prev); __pyx_v_self->prev = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":967 * self.iterseq = iter(seq) * self.prev = PyTuple_New(n) * for i, seq in enumerate(islice(self.iterseq, n-1), 1): # <<<<<<<<<<<<<< * Py_INCREF(seq) * PyTuple_SET_ITEM(self.prev, i, seq) */ __pyx_t_2 = 1; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_islice); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_n - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self->iterseq, __pyx_t_4}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_self->iterseq, __pyx_t_4}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_self->iterseq); __Pyx_GIVEREF(__pyx_v_self->iterseq); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_self->iterseq); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 967, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 967, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 967, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } } else { __pyx_t_1 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 967, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF_SET(__pyx_v_seq, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_i = __pyx_t_2; __pyx_t_2 = (__pyx_t_2 + 1); /* "cytoolz/itertoolz.pyx":968 * self.prev = PyTuple_New(n) * for i, seq in enumerate(islice(self.iterseq, n-1), 1): * Py_INCREF(seq) # <<<<<<<<<<<<<< * PyTuple_SET_ITEM(self.prev, i, seq) * self.n = n */ Py_INCREF(__pyx_v_seq); /* "cytoolz/itertoolz.pyx":969 * for i, seq in enumerate(islice(self.iterseq, n-1), 1): * Py_INCREF(seq) * PyTuple_SET_ITEM(self.prev, i, seq) # <<<<<<<<<<<<<< * self.n = n * */ __pyx_t_1 = __pyx_v_self->prev; __Pyx_INCREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_1, __pyx_v_i, __pyx_v_seq); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":967 * self.iterseq = iter(seq) * self.prev = PyTuple_New(n) * for i, seq in enumerate(islice(self.iterseq, n-1), 1): # <<<<<<<<<<<<<< * Py_INCREF(seq) * PyTuple_SET_ITEM(self.prev, i, seq) */ } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/itertoolz.pyx":970 * Py_INCREF(seq) * PyTuple_SET_ITEM(self.prev, i, seq) * self.n = n # <<<<<<<<<<<<<< * * def __iter__(self): */ __pyx_v_self->n = __pyx_v_n; /* "cytoolz/itertoolz.pyx":963 * [1.5, 2.5, 3.5] * """ * def __cinit__(self, Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * cdef Py_ssize_t i * self.iterseq = iter(seq) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __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_7); __Pyx_AddTraceback("cytoolz.itertoolz.sliding_window.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_seq); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":972 * self.n = n * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_14sliding_window_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_14sliding_window_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_14sliding_window_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_14sliding_window_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* "cytoolz/itertoolz.pyx":973 * * 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; /* "cytoolz/itertoolz.pyx":972 * self.n = n * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":975 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef tuple current * cdef object item */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_14sliding_window_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_14sliding_window_5__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_14sliding_window_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_14sliding_window_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *__pyx_v_self) { PyObject *__pyx_v_current = 0; PyObject *__pyx_v_item = 0; Py_ssize_t __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; Py_ssize_t __pyx_t_5; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":980 * cdef Py_ssize_t i * * item = next(self.iterseq) # <<<<<<<<<<<<<< * current = PyTuple_New(self.n) * Py_INCREF(item) */ __pyx_t_1 = __pyx_v_self->iterseq; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_item = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":981 * * item = next(self.iterseq) * current = PyTuple_New(self.n) # <<<<<<<<<<<<<< * Py_INCREF(item) * PyTuple_SET_ITEM(current, self.n-1, item) */ __pyx_t_2 = PyTuple_New(__pyx_v_self->n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_current = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":982 * item = next(self.iterseq) * current = PyTuple_New(self.n) * Py_INCREF(item) # <<<<<<<<<<<<<< * PyTuple_SET_ITEM(current, self.n-1, item) * for i in range(1, self.n): */ Py_INCREF(__pyx_v_item); /* "cytoolz/itertoolz.pyx":983 * current = PyTuple_New(self.n) * Py_INCREF(item) * PyTuple_SET_ITEM(current, self.n-1, item) # <<<<<<<<<<<<<< * for i in range(1, self.n): * item = self.prev[i] */ PyTuple_SET_ITEM(__pyx_v_current, (__pyx_v_self->n - 1), __pyx_v_item); /* "cytoolz/itertoolz.pyx":984 * Py_INCREF(item) * PyTuple_SET_ITEM(current, self.n-1, item) * for i in range(1, self.n): # <<<<<<<<<<<<<< * item = self.prev[i] * Py_INCREF(item) */ __pyx_t_3 = __pyx_v_self->n; __pyx_t_4 = __pyx_t_3; for (__pyx_t_5 = 1; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { __pyx_v_i = __pyx_t_5; /* "cytoolz/itertoolz.pyx":985 * PyTuple_SET_ITEM(current, self.n-1, item) * for i in range(1, self.n): * item = self.prev[i] # <<<<<<<<<<<<<< * Py_INCREF(item) * PyTuple_SET_ITEM(current, i-1, item) */ if (unlikely(__pyx_v_self->prev == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(0, 985, __pyx_L1_error) } __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_self->prev, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_item, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":986 * for i in range(1, self.n): * item = self.prev[i] * Py_INCREF(item) # <<<<<<<<<<<<<< * PyTuple_SET_ITEM(current, i-1, item) * self.prev = current */ Py_INCREF(__pyx_v_item); /* "cytoolz/itertoolz.pyx":987 * item = self.prev[i] * Py_INCREF(item) * PyTuple_SET_ITEM(current, i-1, item) # <<<<<<<<<<<<<< * self.prev = current * return current */ PyTuple_SET_ITEM(__pyx_v_current, (__pyx_v_i - 1), __pyx_v_item); } /* "cytoolz/itertoolz.pyx":988 * Py_INCREF(item) * PyTuple_SET_ITEM(current, i-1, item) * self.prev = current # <<<<<<<<<<<<<< * return current * */ __Pyx_INCREF(__pyx_v_current); __Pyx_GIVEREF(__pyx_v_current); __Pyx_GOTREF(__pyx_v_self->prev); __Pyx_DECREF(__pyx_v_self->prev); __pyx_v_self->prev = __pyx_v_current; /* "cytoolz/itertoolz.pyx":989 * PyTuple_SET_ITEM(current, i-1, item) * self.prev = current * return current # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_current); __pyx_r = __pyx_v_current; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":975 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef tuple current * cdef object item */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.itertoolz.sliding_window.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_current); __Pyx_XDECREF(__pyx_v_item); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_14sliding_window_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_14sliding_window_6__reduce_cython__[] = "sliding_window.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_14sliding_window_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_14sliding_window_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_14sliding_window_6__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_14sliding_window_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_14sliding_window_6__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_14sliding_window_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz.sliding_window.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_14sliding_window_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_14sliding_window_8__setstate_cython__[] = "sliding_window.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_14sliding_window_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_14sliding_window_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_14sliding_window_8__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_14sliding_window_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_14sliding_window_8__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_14sliding_window_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz.sliding_window.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":995 * * * cpdef object partition(Py_ssize_t n, object seq, object pad='__no__pad__'): # <<<<<<<<<<<<<< * """ * Partition sequence into tuples of length n */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_45partition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_partition(Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_partition *__pyx_optional_args) { PyObject *__pyx_v_pad = ((PyObject *)__pyx_n_s_no__pad); PyObject *__pyx_v_args = NULL; 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; __Pyx_RefNannySetupContext("partition", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_pad = __pyx_optional_args->pad; } } /* "cytoolz/itertoolz.pyx":1014 * partition_all * """ * args = [iter(seq)] * n # <<<<<<<<<<<<<< * if pad == '__no__pad__': * return zip(*args) */ __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyList_New(1 * ((__pyx_v_n<0) ? 0:__pyx_v_n)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < __pyx_v_n; __pyx_temp++) { __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyList_SET_ITEM(__pyx_t_2, __pyx_temp, __pyx_t_1); } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_args = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1015 * """ * args = [iter(seq)] * n * if pad == '__no__pad__': # <<<<<<<<<<<<<< * return zip(*args) * else: */ __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_pad, __pyx_n_s_no__pad, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1015, __pyx_L1_error) if (__pyx_t_3) { /* "cytoolz/itertoolz.pyx":1016 * args = [iter(seq)] * n * if pad == '__no__pad__': * return zip(*args) # <<<<<<<<<<<<<< * else: * return zip_longest(*args, fillvalue=pad) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_zip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1015 * """ * args = [iter(seq)] * n * if pad == '__no__pad__': # <<<<<<<<<<<<<< * return zip(*args) * else: */ } /* "cytoolz/itertoolz.pyx":1018 * return zip(*args) * else: * return zip_longest(*args, fillvalue=pad) # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_zip_longest); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fillvalue, __pyx_v_pad) < 0) __PYX_ERR(0, 1018, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; } /* "cytoolz/itertoolz.pyx":995 * * * cpdef object partition(Py_ssize_t n, object seq, object pad='__no__pad__'): # <<<<<<<<<<<<<< * """ * Partition sequence into tuples of length 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); __Pyx_AddTraceback("cytoolz.itertoolz.partition", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_args); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_45partition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_44partition[] = "partition(Py_ssize_t n, seq, pad='__no__pad__')\n\n Partition sequence into tuples of length n\n\n >>> list(partition(2, [1, 2, 3, 4]))\n [(1, 2), (3, 4)]\n\n If the length of ``seq`` is not evenly divisible by ``n``, the final tuple\n is dropped if ``pad`` is not specified, or filled to length ``n`` by pad:\n\n >>> list(partition(2, [1, 2, 3, 4, 5]))\n [(1, 2), (3, 4)]\n\n >>> list(partition(2, [1, 2, 3, 4, 5], pad=None))\n [(1, 2), (3, 4), (5, None)]\n\n See Also:\n partition_all\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_45partition = {"partition", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9itertoolz_45partition, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9itertoolz_44partition}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_45partition(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { Py_ssize_t __pyx_v_n; PyObject *__pyx_v_seq = 0; PyObject *__pyx_v_pad = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("partition (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_seq,&__pyx_n_s_pad,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)__pyx_n_s_no__pad); 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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("partition", 0, 2, 3, 1); __PYX_ERR(0, 995, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pad); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "partition") < 0)) __PYX_ERR(0, 995, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; 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_n = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_n == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 995, __pyx_L3_error) __pyx_v_seq = values[1]; __pyx_v_pad = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("partition", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 995, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.partition", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_44partition(__pyx_self, __pyx_v_n, __pyx_v_seq, __pyx_v_pad); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_44partition(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq, PyObject *__pyx_v_pad) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_7cytoolz_9itertoolz_partition __pyx_t_2; __Pyx_RefNannySetupContext("partition", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.pad = __pyx_v_pad; __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_partition(__pyx_v_n, __pyx_v_seq, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.partition", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1037 * partition * """ * def __cinit__(self, Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * self.n = n * self.iterseq = iter(seq) */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9itertoolz_13partition_all_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9itertoolz_13partition_all_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { Py_ssize_t __pyx_v_n; PyObject *__pyx_v_seq = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_seq,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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 1037, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1037, __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_n = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_n == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1037, __pyx_L3_error) __pyx_v_seq = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1037, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.partition_all.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13partition_all___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz_partition_all *)__pyx_v_self), __pyx_v_n, __pyx_v_seq); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9itertoolz_13partition_all___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_partition_all *__pyx_v_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/itertoolz.pyx":1038 * """ * def __cinit__(self, Py_ssize_t n, object seq): * self.n = n # <<<<<<<<<<<<<< * self.iterseq = iter(seq) * */ __pyx_v_self->n = __pyx_v_n; /* "cytoolz/itertoolz.pyx":1039 * def __cinit__(self, Py_ssize_t n, object seq): * self.n = n * self.iterseq = iter(seq) # <<<<<<<<<<<<<< * * def __iter__(self): */ __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->iterseq); __Pyx_DECREF(__pyx_v_self->iterseq); __pyx_v_self->iterseq = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1037 * partition * """ * def __cinit__(self, Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * self.n = n * self.iterseq = iter(seq) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz.partition_all.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1041 * self.iterseq = iter(seq) * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13partition_all_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13partition_all_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13partition_all_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz_partition_all *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_13partition_all_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_partition_all *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* "cytoolz/itertoolz.pyx":1042 * * 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; /* "cytoolz/itertoolz.pyx":1041 * self.iterseq = iter(seq) * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1044 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef tuple result * cdef object item */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13partition_all_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13partition_all_5__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13partition_all_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz_partition_all *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_13partition_all_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_partition_all *__pyx_v_self) { PyObject *__pyx_v_result = 0; PyObject *__pyx_v_item = 0; Py_ssize_t __pyx_v_i; 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; int __pyx_t_5; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":1047 * cdef tuple result * cdef object item * cdef Py_ssize_t i = 0 # <<<<<<<<<<<<<< * result = PyTuple_New(self.n) * for item in self.iterseq: */ __pyx_v_i = 0; /* "cytoolz/itertoolz.pyx":1048 * cdef object item * cdef Py_ssize_t i = 0 * result = PyTuple_New(self.n) # <<<<<<<<<<<<<< * for item in self.iterseq: * Py_INCREF(item) */ __pyx_t_1 = PyTuple_New(__pyx_v_self->n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1049 * cdef Py_ssize_t i = 0 * result = PyTuple_New(self.n) * for item in self.iterseq: # <<<<<<<<<<<<<< * Py_INCREF(item) * PyTuple_SET_ITEM(result, i, item) */ if (likely(PyList_CheckExact(__pyx_v_self->iterseq)) || PyTuple_CheckExact(__pyx_v_self->iterseq)) { __pyx_t_1 = __pyx_v_self->iterseq; __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_self->iterseq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1049, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 1049, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 1049, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 1049, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/itertoolz.pyx":1050 * result = PyTuple_New(self.n) * for item in self.iterseq: * Py_INCREF(item) # <<<<<<<<<<<<<< * PyTuple_SET_ITEM(result, i, item) * i += 1 */ Py_INCREF(__pyx_v_item); /* "cytoolz/itertoolz.pyx":1051 * for item in self.iterseq: * Py_INCREF(item) * PyTuple_SET_ITEM(result, i, item) # <<<<<<<<<<<<<< * i += 1 * if i == self.n: */ PyTuple_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_item); /* "cytoolz/itertoolz.pyx":1052 * Py_INCREF(item) * PyTuple_SET_ITEM(result, i, item) * i += 1 # <<<<<<<<<<<<<< * if i == self.n: * return result */ __pyx_v_i = (__pyx_v_i + 1); /* "cytoolz/itertoolz.pyx":1053 * PyTuple_SET_ITEM(result, i, item) * i += 1 * if i == self.n: # <<<<<<<<<<<<<< * return result * # iterable exhausted before filling the tuple */ __pyx_t_5 = ((__pyx_v_i == __pyx_v_self->n) != 0); if (__pyx_t_5) { /* "cytoolz/itertoolz.pyx":1054 * i += 1 * if i == self.n: * return result # <<<<<<<<<<<<<< * # iterable exhausted before filling the tuple * if i == 0: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1053 * PyTuple_SET_ITEM(result, i, item) * i += 1 * if i == self.n: # <<<<<<<<<<<<<< * return result * # iterable exhausted before filling the tuple */ } /* "cytoolz/itertoolz.pyx":1049 * cdef Py_ssize_t i = 0 * result = PyTuple_New(self.n) * for item in self.iterseq: # <<<<<<<<<<<<<< * Py_INCREF(item) * PyTuple_SET_ITEM(result, i, item) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1056 * return result * # iterable exhausted before filling the tuple * if i == 0: # <<<<<<<<<<<<<< * raise StopIteration * return PyTuple_GetSlice(result, 0, i) */ __pyx_t_5 = ((__pyx_v_i == 0) != 0); if (unlikely(__pyx_t_5)) { /* "cytoolz/itertoolz.pyx":1057 * # iterable exhausted before filling the tuple * if i == 0: * raise StopIteration # <<<<<<<<<<<<<< * return PyTuple_GetSlice(result, 0, i) * */ __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0); __PYX_ERR(0, 1057, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":1056 * return result * # iterable exhausted before filling the tuple * if i == 0: # <<<<<<<<<<<<<< * raise StopIteration * return PyTuple_GetSlice(result, 0, i) */ } /* "cytoolz/itertoolz.pyx":1058 * if i == 0: * raise StopIteration * return PyTuple_GetSlice(result, 0, i) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_GetSlice(__pyx_v_result, 0, __pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1058, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1044 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef tuple result * cdef object item */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("cytoolz.itertoolz.partition_all.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_item); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13partition_all_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_13partition_all_6__reduce_cython__[] = "partition_all.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_13partition_all_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_13partition_all_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_13partition_all_6__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_13partition_all_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13partition_all_6__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz_partition_all *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_13partition_all_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_partition_all *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz.partition_all.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13partition_all_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_13partition_all_8__setstate_cython__[] = "partition_all.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_13partition_all_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_13partition_all_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_13partition_all_8__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_13partition_all_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13partition_all_8__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz_partition_all *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_13partition_all_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_partition_all *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz.partition_all.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1061 * * * cpdef object count(object seq): # <<<<<<<<<<<<<< * """ * Count the number of items in seq */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_47count(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_count(PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) { Py_ssize_t __pyx_v_i; CYTHON_UNUSED PyObject *__pyx_v__ = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; int __pyx_t_4; Py_ssize_t __pyx_t_5; PyObject *(*__pyx_t_6)(PyObject *); PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("count", 0); /* "cytoolz/itertoolz.pyx":1072 * len * """ * if iter(seq) is not seq and hasattr(seq, '__len__'): # <<<<<<<<<<<<<< * return len(seq) * cdef Py_ssize_t i = 0 */ __pyx_t_2 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = (__pyx_t_2 != __pyx_v_seq); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_HasAttr(__pyx_v_seq, __pyx_n_s_len); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1072, __pyx_L1_error) __pyx_t_3 = (__pyx_t_4 != 0); __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":1073 * """ * if iter(seq) is not seq and hasattr(seq, '__len__'): * return len(seq) # <<<<<<<<<<<<<< * cdef Py_ssize_t i = 0 * for _ in seq: */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = PyObject_Length(__pyx_v_seq); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1073, __pyx_L1_error) __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1073, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1072 * len * """ * if iter(seq) is not seq and hasattr(seq, '__len__'): # <<<<<<<<<<<<<< * return len(seq) * cdef Py_ssize_t i = 0 */ } /* "cytoolz/itertoolz.pyx":1074 * if iter(seq) is not seq and hasattr(seq, '__len__'): * return len(seq) * cdef Py_ssize_t i = 0 # <<<<<<<<<<<<<< * for _ in seq: * i += 1 */ __pyx_v_i = 0; /* "cytoolz/itertoolz.pyx":1075 * return len(seq) * cdef Py_ssize_t i = 0 * for _ in seq: # <<<<<<<<<<<<<< * i += 1 * return i */ if (likely(PyList_CheckExact(__pyx_v_seq)) || PyTuple_CheckExact(__pyx_v_seq)) { __pyx_t_2 = __pyx_v_seq; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1075, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_6)) { if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 1075, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 1075, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 1075, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_7); __pyx_t_7 = 0; /* "cytoolz/itertoolz.pyx":1076 * cdef Py_ssize_t i = 0 * for _ in seq: * i += 1 # <<<<<<<<<<<<<< * return i * */ __pyx_v_i = (__pyx_v_i + 1); /* "cytoolz/itertoolz.pyx":1075 * return len(seq) * cdef Py_ssize_t i = 0 * for _ in seq: # <<<<<<<<<<<<<< * i += 1 * return i */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1077 * for _ in seq: * i += 1 * return i # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1061 * * * cpdef object count(object seq): # <<<<<<<<<<<<<< * """ * Count the number of items in seq */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("cytoolz.itertoolz.count", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v__); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_47count(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_46count[] = "count(seq)\n\n Count the number of items in seq\n\n Like the builtin ``len`` but works on lazy sequencies.\n\n Not to be confused with ``itertools.count``\n\n See also:\n len\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_47count = {"count", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_47count, METH_O, __pyx_doc_7cytoolz_9itertoolz_46count}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_47count(PyObject *__pyx_self, PyObject *__pyx_v_seq) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("count (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_46count(__pyx_self, ((PyObject *)__pyx_v_seq)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_46count(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("count", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_count(__pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.count", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1081 * * cdef class _pluck_index: * def __cinit__(self, object ind, object seqs): # <<<<<<<<<<<<<< * self.ind = ind * self.iterseqs = iter(seqs) */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9itertoolz_12_pluck_index_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9itertoolz_12_pluck_index_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ind = 0; PyObject *__pyx_v_seqs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ind,&__pyx_n_s_seqs,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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ind)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seqs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 1081, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1081, __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_ind = values[0]; __pyx_v_seqs = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1081, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz._pluck_index.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_12_pluck_index___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *)__pyx_v_self), __pyx_v_ind, __pyx_v_seqs); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9itertoolz_12_pluck_index___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *__pyx_v_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/itertoolz.pyx":1082 * cdef class _pluck_index: * def __cinit__(self, object ind, object seqs): * self.ind = ind # <<<<<<<<<<<<<< * self.iterseqs = iter(seqs) * */ __Pyx_INCREF(__pyx_v_ind); __Pyx_GIVEREF(__pyx_v_ind); __Pyx_GOTREF(__pyx_v_self->ind); __Pyx_DECREF(__pyx_v_self->ind); __pyx_v_self->ind = __pyx_v_ind; /* "cytoolz/itertoolz.pyx":1083 * def __cinit__(self, object ind, object seqs): * self.ind = ind * self.iterseqs = iter(seqs) # <<<<<<<<<<<<<< * * def __iter__(self): */ __pyx_t_1 = PyObject_GetIter(__pyx_v_seqs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->iterseqs); __Pyx_DECREF(__pyx_v_self->iterseqs); __pyx_v_self->iterseqs = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1081 * * cdef class _pluck_index: * def __cinit__(self, object ind, object seqs): # <<<<<<<<<<<<<< * self.ind = ind * self.iterseqs = iter(seqs) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._pluck_index.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1085 * self.iterseqs = iter(seqs) * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_pluck_index_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_pluck_index_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_12_pluck_index_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_pluck_index_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* "cytoolz/itertoolz.pyx":1086 * * 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; /* "cytoolz/itertoolz.pyx":1085 * self.iterseqs = iter(seqs) * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1088 * return self * * def __next__(self): # <<<<<<<<<<<<<< * val = next(self.iterseqs) * return val[self.ind] */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_pluck_index_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_pluck_index_5__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_12_pluck_index_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_pluck_index_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *__pyx_v_self) { PyObject *__pyx_v_val = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":1089 * * def __next__(self): * val = next(self.iterseqs) # <<<<<<<<<<<<<< * return val[self.ind] * */ __pyx_t_1 = __pyx_v_self->iterseqs; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1089, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_val = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1090 * def __next__(self): * val = next(self.iterseqs) * return val[self.ind] # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_val, __pyx_v_self->ind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1090, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1088 * return self * * def __next__(self): # <<<<<<<<<<<<<< * val = next(self.iterseqs) * return val[self.ind] */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.itertoolz._pluck_index.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_pluck_index_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_12_pluck_index_6__reduce_cython__[] = "_pluck_index.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_12_pluck_index_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_12_pluck_index_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_12_pluck_index_6__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_pluck_index_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_12_pluck_index_6__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_pluck_index_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._pluck_index.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_pluck_index_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_12_pluck_index_8__setstate_cython__[] = "_pluck_index.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_12_pluck_index_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_12_pluck_index_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_12_pluck_index_8__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_pluck_index_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_12_pluck_index_8__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_pluck_index_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._pluck_index.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1094 * * cdef class _pluck_index_default: * def __cinit__(self, object ind, object seqs, object default): # <<<<<<<<<<<<<< * self.ind = ind * self.iterseqs = iter(seqs) */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ind = 0; PyObject *__pyx_v_seqs = 0; PyObject *__pyx_v_default = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ind,&__pyx_n_s_seqs,&__pyx_n_s_default,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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ind)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seqs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); __PYX_ERR(0, 1094, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); __PYX_ERR(0, 1094, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1094, __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_ind = values[0]; __pyx_v_seqs = values[1]; __pyx_v_default = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1094, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz._pluck_index_default.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *)__pyx_v_self), __pyx_v_ind, __pyx_v_seqs, __pyx_v_default); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *__pyx_v_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs, PyObject *__pyx_v_default) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/itertoolz.pyx":1095 * cdef class _pluck_index_default: * def __cinit__(self, object ind, object seqs, object default): * self.ind = ind # <<<<<<<<<<<<<< * self.iterseqs = iter(seqs) * self.default = default */ __Pyx_INCREF(__pyx_v_ind); __Pyx_GIVEREF(__pyx_v_ind); __Pyx_GOTREF(__pyx_v_self->ind); __Pyx_DECREF(__pyx_v_self->ind); __pyx_v_self->ind = __pyx_v_ind; /* "cytoolz/itertoolz.pyx":1096 * def __cinit__(self, object ind, object seqs, object default): * self.ind = ind * self.iterseqs = iter(seqs) # <<<<<<<<<<<<<< * self.default = default * */ __pyx_t_1 = PyObject_GetIter(__pyx_v_seqs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->iterseqs); __Pyx_DECREF(__pyx_v_self->iterseqs); __pyx_v_self->iterseqs = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1097 * self.ind = ind * self.iterseqs = iter(seqs) * self.default = default # <<<<<<<<<<<<<< * * def __iter__(self): */ __Pyx_INCREF(__pyx_v_default); __Pyx_GIVEREF(__pyx_v_default); __Pyx_GOTREF(__pyx_v_self->__pyx_default); __Pyx_DECREF(__pyx_v_self->__pyx_default); __pyx_v_self->__pyx_default = __pyx_v_default; /* "cytoolz/itertoolz.pyx":1094 * * cdef class _pluck_index_default: * def __cinit__(self, object ind, object seqs, object default): # <<<<<<<<<<<<<< * self.ind = ind * self.iterseqs = iter(seqs) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._pluck_index_default.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1099 * self.default = default * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* "cytoolz/itertoolz.pyx":1100 * * 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; /* "cytoolz/itertoolz.pyx":1099 * self.default = default * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1102 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef PyObject *obj * cdef object val */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_5__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *__pyx_v_self) { PyObject *__pyx_v_obj; PyObject *__pyx_v_val = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; PyObject *__pyx_t_4; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":1105 * cdef PyObject *obj * cdef object val * val = next(self.iterseqs) # <<<<<<<<<<<<<< * obj = PtrObject_GetItem(val, self.ind) * if obj is NULL: */ __pyx_t_1 = __pyx_v_self->iterseqs; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_val = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1106 * cdef object val * val = next(self.iterseqs) * obj = PtrObject_GetItem(val, self.ind) # <<<<<<<<<<<<<< * if obj is NULL: * val = PyErr_Occurred() */ __pyx_t_2 = __pyx_v_self->ind; __Pyx_INCREF(__pyx_t_2); __pyx_v_obj = PyObject_GetItem(__pyx_v_val, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1107 * val = next(self.iterseqs) * obj = PtrObject_GetItem(val, self.ind) * if obj is NULL: # <<<<<<<<<<<<<< * val = PyErr_Occurred() * PyErr_Clear() */ __pyx_t_3 = ((__pyx_v_obj == NULL) != 0); if (__pyx_t_3) { /* "cytoolz/itertoolz.pyx":1108 * obj = PtrObject_GetItem(val, self.ind) * if obj is NULL: * val = PyErr_Occurred() # <<<<<<<<<<<<<< * PyErr_Clear() * if not PyErr_GivenExceptionMatches(val, _get_exceptions): */ __pyx_t_4 = PyErr_Occurred(); __pyx_t_2 = ((PyObject *)__pyx_t_4); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1109 * if obj is NULL: * val = PyErr_Occurred() * PyErr_Clear() # <<<<<<<<<<<<<< * if not PyErr_GivenExceptionMatches(val, _get_exceptions): * raise val */ PyErr_Clear(); /* "cytoolz/itertoolz.pyx":1110 * val = PyErr_Occurred() * PyErr_Clear() * if not PyErr_GivenExceptionMatches(val, _get_exceptions): # <<<<<<<<<<<<<< * raise val * return self.default */ __pyx_t_2 = __pyx_v_7cytoolz_9itertoolz__get_exceptions; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = ((!(PyErr_GivenExceptionMatches(__pyx_v_val, __pyx_t_2) != 0)) != 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_3)) { /* "cytoolz/itertoolz.pyx":1111 * PyErr_Clear() * if not PyErr_GivenExceptionMatches(val, _get_exceptions): * raise val # <<<<<<<<<<<<<< * return self.default * val = obj */ __Pyx_Raise(__pyx_v_val, 0, 0, 0); __PYX_ERR(0, 1111, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":1110 * val = PyErr_Occurred() * PyErr_Clear() * if not PyErr_GivenExceptionMatches(val, _get_exceptions): # <<<<<<<<<<<<<< * raise val * return self.default */ } /* "cytoolz/itertoolz.pyx":1112 * if not PyErr_GivenExceptionMatches(val, _get_exceptions): * raise val * return self.default # <<<<<<<<<<<<<< * val = obj * Py_XDECREF(obj) */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->__pyx_default); __pyx_r = __pyx_v_self->__pyx_default; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1107 * val = next(self.iterseqs) * obj = PtrObject_GetItem(val, self.ind) * if obj is NULL: # <<<<<<<<<<<<<< * val = PyErr_Occurred() * PyErr_Clear() */ } /* "cytoolz/itertoolz.pyx":1113 * raise val * return self.default * val = obj # <<<<<<<<<<<<<< * Py_XDECREF(obj) * return val */ __pyx_t_2 = ((PyObject *)__pyx_v_obj); __Pyx_INCREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1114 * return self.default * val = obj * Py_XDECREF(obj) # <<<<<<<<<<<<<< * return val * */ Py_XDECREF(__pyx_v_obj); /* "cytoolz/itertoolz.pyx":1115 * val = obj * Py_XDECREF(obj) * return val # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_val); __pyx_r = __pyx_v_val; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1102 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef PyObject *obj * cdef object val */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.itertoolz._pluck_index_default.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_20_pluck_index_default_6__reduce_cython__[] = "_pluck_index_default.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_20_pluck_index_default_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_20_pluck_index_default_6__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default_6__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._pluck_index_default.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_20_pluck_index_default_8__setstate_cython__[] = "_pluck_index_default.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_20_pluck_index_default_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_20_pluck_index_default_8__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default_8__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_20_pluck_index_default_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._pluck_index_default.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1119 * * cdef class _pluck_list: * def __cinit__(self, list ind not None, object seqs): # <<<<<<<<<<<<<< * self.ind = ind * self.iterseqs = iter(seqs) */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9itertoolz_11_pluck_list_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9itertoolz_11_pluck_list_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ind = 0; PyObject *__pyx_v_seqs = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ind,&__pyx_n_s_seqs,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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ind)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seqs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(0, 1119, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1119, __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_ind = ((PyObject*)values[0]); __pyx_v_seqs = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1119, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz._pluck_list.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ind), (&PyList_Type), 0, "ind", 1))) __PYX_ERR(0, 1119, __pyx_L1_error) __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_pluck_list___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *)__pyx_v_self), __pyx_v_ind, __pyx_v_seqs); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9itertoolz_11_pluck_list___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *__pyx_v_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/itertoolz.pyx":1120 * cdef class _pluck_list: * def __cinit__(self, list ind not None, object seqs): * self.ind = ind # <<<<<<<<<<<<<< * self.iterseqs = iter(seqs) * self.n = len(ind) */ __Pyx_INCREF(__pyx_v_ind); __Pyx_GIVEREF(__pyx_v_ind); __Pyx_GOTREF(__pyx_v_self->ind); __Pyx_DECREF(__pyx_v_self->ind); __pyx_v_self->ind = __pyx_v_ind; /* "cytoolz/itertoolz.pyx":1121 * def __cinit__(self, list ind not None, object seqs): * self.ind = ind * self.iterseqs = iter(seqs) # <<<<<<<<<<<<<< * self.n = len(ind) * */ __pyx_t_1 = PyObject_GetIter(__pyx_v_seqs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->iterseqs); __Pyx_DECREF(__pyx_v_self->iterseqs); __pyx_v_self->iterseqs = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1122 * self.ind = ind * self.iterseqs = iter(seqs) * self.n = len(ind) # <<<<<<<<<<<<<< * * def __iter__(self): */ __pyx_t_2 = PyList_GET_SIZE(__pyx_v_ind); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1122, __pyx_L1_error) __pyx_v_self->n = __pyx_t_2; /* "cytoolz/itertoolz.pyx":1119 * * cdef class _pluck_list: * def __cinit__(self, list ind not None, object seqs): # <<<<<<<<<<<<<< * self.ind = ind * self.iterseqs = iter(seqs) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._pluck_list.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1124 * self.n = len(ind) * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_pluck_list_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_pluck_list_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_pluck_list_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_pluck_list_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* "cytoolz/itertoolz.pyx":1125 * * 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; /* "cytoolz/itertoolz.pyx":1124 * self.n = len(ind) * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1127 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef Py_ssize_t i * cdef tuple result */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_pluck_list_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_pluck_list_5__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_pluck_list_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_pluck_list_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *__pyx_v_self) { Py_ssize_t __pyx_v_i; PyObject *__pyx_v_result = 0; PyObject *__pyx_v_val = 0; PyObject *__pyx_v_seq = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":1131 * cdef tuple result * cdef object val, seq * seq = next(self.iterseqs) # <<<<<<<<<<<<<< * result = PyTuple_New(self.n) * for i, val in enumerate(self.ind): */ __pyx_t_1 = __pyx_v_self->iterseqs; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_seq = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1132 * cdef object val, seq * seq = next(self.iterseqs) * result = PyTuple_New(self.n) # <<<<<<<<<<<<<< * for i, val in enumerate(self.ind): * val = seq[val] */ __pyx_t_2 = PyTuple_New(__pyx_v_self->n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_result = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1133 * seq = next(self.iterseqs) * result = PyTuple_New(self.n) * for i, val in enumerate(self.ind): # <<<<<<<<<<<<<< * val = seq[val] * Py_INCREF(val) */ __pyx_t_3 = 0; __pyx_t_2 = __pyx_v_self->ind; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; for (;;) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1133, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1133, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_i = __pyx_t_3; __pyx_t_3 = (__pyx_t_3 + 1); /* "cytoolz/itertoolz.pyx":1134 * result = PyTuple_New(self.n) * for i, val in enumerate(self.ind): * val = seq[val] # <<<<<<<<<<<<<< * Py_INCREF(val) * PyTuple_SET_ITEM(result, i, val) */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_seq, __pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1135 * for i, val in enumerate(self.ind): * val = seq[val] * Py_INCREF(val) # <<<<<<<<<<<<<< * PyTuple_SET_ITEM(result, i, val) * return result */ Py_INCREF(__pyx_v_val); /* "cytoolz/itertoolz.pyx":1136 * val = seq[val] * Py_INCREF(val) * PyTuple_SET_ITEM(result, i, val) # <<<<<<<<<<<<<< * return result * */ PyTuple_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_val); /* "cytoolz/itertoolz.pyx":1133 * seq = next(self.iterseqs) * result = PyTuple_New(self.n) * for i, val in enumerate(self.ind): # <<<<<<<<<<<<<< * val = seq[val] * Py_INCREF(val) */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1137 * Py_INCREF(val) * PyTuple_SET_ITEM(result, i, val) * return result # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1127 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef Py_ssize_t i * cdef tuple result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.itertoolz._pluck_list.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_val); __Pyx_XDECREF(__pyx_v_seq); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_pluck_list_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_11_pluck_list_6__reduce_cython__[] = "_pluck_list.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_11_pluck_list_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11_pluck_list_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_11_pluck_list_6__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_pluck_list_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_pluck_list_6__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_pluck_list_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._pluck_list.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_pluck_list_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_11_pluck_list_8__setstate_cython__[] = "_pluck_list.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_11_pluck_list_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11_pluck_list_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_11_pluck_list_8__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_pluck_list_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_pluck_list_8__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_pluck_list_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._pluck_list.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1141 * * cdef class _pluck_list_default: * def __cinit__(self, list ind not None, object seqs, object default): # <<<<<<<<<<<<<< * self.ind = ind * self.iterseqs = iter(seqs) */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ind = 0; PyObject *__pyx_v_seqs = 0; PyObject *__pyx_v_default = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ind,&__pyx_n_s_seqs,&__pyx_n_s_default,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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ind)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seqs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); __PYX_ERR(0, 1141, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); __PYX_ERR(0, 1141, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1141, __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_ind = ((PyObject*)values[0]); __pyx_v_seqs = values[1]; __pyx_v_default = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1141, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz._pluck_list_default.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ind), (&PyList_Type), 0, "ind", 1))) __PYX_ERR(0, 1141, __pyx_L1_error) __pyx_r = __pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *)__pyx_v_self), __pyx_v_ind, __pyx_v_seqs, __pyx_v_default); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *__pyx_v_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs, PyObject *__pyx_v_default) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/itertoolz.pyx":1142 * cdef class _pluck_list_default: * def __cinit__(self, list ind not None, object seqs, object default): * self.ind = ind # <<<<<<<<<<<<<< * self.iterseqs = iter(seqs) * self.default = default */ __Pyx_INCREF(__pyx_v_ind); __Pyx_GIVEREF(__pyx_v_ind); __Pyx_GOTREF(__pyx_v_self->ind); __Pyx_DECREF(__pyx_v_self->ind); __pyx_v_self->ind = __pyx_v_ind; /* "cytoolz/itertoolz.pyx":1143 * def __cinit__(self, list ind not None, object seqs, object default): * self.ind = ind * self.iterseqs = iter(seqs) # <<<<<<<<<<<<<< * self.default = default * self.n = len(ind) */ __pyx_t_1 = PyObject_GetIter(__pyx_v_seqs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1143, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->iterseqs); __Pyx_DECREF(__pyx_v_self->iterseqs); __pyx_v_self->iterseqs = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1144 * self.ind = ind * self.iterseqs = iter(seqs) * self.default = default # <<<<<<<<<<<<<< * self.n = len(ind) * */ __Pyx_INCREF(__pyx_v_default); __Pyx_GIVEREF(__pyx_v_default); __Pyx_GOTREF(__pyx_v_self->__pyx_default); __Pyx_DECREF(__pyx_v_self->__pyx_default); __pyx_v_self->__pyx_default = __pyx_v_default; /* "cytoolz/itertoolz.pyx":1145 * self.iterseqs = iter(seqs) * self.default = default * self.n = len(ind) # <<<<<<<<<<<<<< * * def __iter__(self): */ __pyx_t_2 = PyList_GET_SIZE(__pyx_v_ind); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1145, __pyx_L1_error) __pyx_v_self->n = __pyx_t_2; /* "cytoolz/itertoolz.pyx":1141 * * cdef class _pluck_list_default: * def __cinit__(self, list ind not None, object seqs, object default): # <<<<<<<<<<<<<< * self.ind = ind * self.iterseqs = iter(seqs) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._pluck_list_default.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1147 * self.n = len(ind) * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* "cytoolz/itertoolz.pyx":1148 * * 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; /* "cytoolz/itertoolz.pyx":1147 * self.n = len(ind) * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1150 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef Py_ssize_t i * cdef object val, seq */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_5__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *__pyx_v_self) { Py_ssize_t __pyx_v_i; PyObject *__pyx_v_val = 0; PyObject *__pyx_v_seq = 0; PyObject *__pyx_v_result = 0; PyObject *__pyx_v_obj; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; Py_ssize_t __pyx_t_3; Py_ssize_t __pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":1154 * cdef object val, seq * cdef tuple result * seq = next(self.iterseqs) # <<<<<<<<<<<<<< * result = PyTuple_New(self.n) * for i, val in enumerate(self.ind): */ __pyx_t_1 = __pyx_v_self->iterseqs; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_seq = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1155 * cdef tuple result * seq = next(self.iterseqs) * result = PyTuple_New(self.n) # <<<<<<<<<<<<<< * for i, val in enumerate(self.ind): * obj = PtrObject_GetItem(seq, val) */ __pyx_t_2 = PyTuple_New(__pyx_v_self->n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_result = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1156 * seq = next(self.iterseqs) * result = PyTuple_New(self.n) * for i, val in enumerate(self.ind): # <<<<<<<<<<<<<< * obj = PtrObject_GetItem(seq, val) * if obj is NULL: */ __pyx_t_3 = 0; __pyx_t_2 = __pyx_v_self->ind; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0; for (;;) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1156, __pyx_L1_error) #else __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; __pyx_v_i = __pyx_t_3; __pyx_t_3 = (__pyx_t_3 + 1); /* "cytoolz/itertoolz.pyx":1157 * result = PyTuple_New(self.n) * for i, val in enumerate(self.ind): * obj = PtrObject_GetItem(seq, val) # <<<<<<<<<<<<<< * if obj is NULL: * val = PyErr_Occurred() */ __pyx_v_obj = PyObject_GetItem(__pyx_v_seq, __pyx_v_val); /* "cytoolz/itertoolz.pyx":1158 * for i, val in enumerate(self.ind): * obj = PtrObject_GetItem(seq, val) * if obj is NULL: # <<<<<<<<<<<<<< * val = PyErr_Occurred() * PyErr_Clear() */ __pyx_t_5 = ((__pyx_v_obj == NULL) != 0); if (__pyx_t_5) { /* "cytoolz/itertoolz.pyx":1159 * obj = PtrObject_GetItem(seq, val) * if obj is NULL: * val = PyErr_Occurred() # <<<<<<<<<<<<<< * PyErr_Clear() * if not PyErr_GivenExceptionMatches(val, _get_list_exc): */ __pyx_t_6 = PyErr_Occurred(); __pyx_t_1 = ((PyObject *)__pyx_t_6); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1160 * if obj is NULL: * val = PyErr_Occurred() * PyErr_Clear() # <<<<<<<<<<<<<< * if not PyErr_GivenExceptionMatches(val, _get_list_exc): * raise val */ PyErr_Clear(); /* "cytoolz/itertoolz.pyx":1161 * val = PyErr_Occurred() * PyErr_Clear() * if not PyErr_GivenExceptionMatches(val, _get_list_exc): # <<<<<<<<<<<<<< * raise val * Py_INCREF(self.default) */ __pyx_t_1 = __pyx_v_7cytoolz_9itertoolz__get_list_exc; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = ((!(PyErr_GivenExceptionMatches(__pyx_v_val, __pyx_t_1) != 0)) != 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (unlikely(__pyx_t_5)) { /* "cytoolz/itertoolz.pyx":1162 * PyErr_Clear() * if not PyErr_GivenExceptionMatches(val, _get_list_exc): * raise val # <<<<<<<<<<<<<< * Py_INCREF(self.default) * PyTuple_SET_ITEM(result, i, self.default) */ __Pyx_Raise(__pyx_v_val, 0, 0, 0); __PYX_ERR(0, 1162, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":1161 * val = PyErr_Occurred() * PyErr_Clear() * if not PyErr_GivenExceptionMatches(val, _get_list_exc): # <<<<<<<<<<<<<< * raise val * Py_INCREF(self.default) */ } /* "cytoolz/itertoolz.pyx":1163 * if not PyErr_GivenExceptionMatches(val, _get_list_exc): * raise val * Py_INCREF(self.default) # <<<<<<<<<<<<<< * PyTuple_SET_ITEM(result, i, self.default) * else: */ __pyx_t_1 = __pyx_v_self->__pyx_default; __Pyx_INCREF(__pyx_t_1); Py_INCREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1164 * raise val * Py_INCREF(self.default) * PyTuple_SET_ITEM(result, i, self.default) # <<<<<<<<<<<<<< * else: * val = obj */ __pyx_t_1 = __pyx_v_self->__pyx_default; __Pyx_INCREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1158 * for i, val in enumerate(self.ind): * obj = PtrObject_GetItem(seq, val) * if obj is NULL: # <<<<<<<<<<<<<< * val = PyErr_Occurred() * PyErr_Clear() */ goto __pyx_L5; } /* "cytoolz/itertoolz.pyx":1166 * PyTuple_SET_ITEM(result, i, self.default) * else: * val = obj # <<<<<<<<<<<<<< * PyTuple_SET_ITEM(result, i, val) * return result */ /*else*/ { __pyx_t_1 = ((PyObject *)__pyx_v_obj); __Pyx_INCREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1167 * else: * val = obj * PyTuple_SET_ITEM(result, i, val) # <<<<<<<<<<<<<< * return result * */ PyTuple_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_val); } __pyx_L5:; /* "cytoolz/itertoolz.pyx":1156 * seq = next(self.iterseqs) * result = PyTuple_New(self.n) * for i, val in enumerate(self.ind): # <<<<<<<<<<<<<< * obj = PtrObject_GetItem(seq, val) * if obj is NULL: */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1168 * val = obj * PyTuple_SET_ITEM(result, i, val) * return result # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1150 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef Py_ssize_t i * cdef object val, seq */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("cytoolz.itertoolz._pluck_list_default.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_val); __Pyx_XDECREF(__pyx_v_seq); __Pyx_XDECREF(__pyx_v_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_19_pluck_list_default_6__reduce_cython__[] = "_pluck_list_default.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_19_pluck_list_default_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_19_pluck_list_default_6__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default_6__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._pluck_list_default.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_19_pluck_list_default_8__setstate_cython__[] = "_pluck_list_default.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_19_pluck_list_default_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_19_pluck_list_default_8__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default_8__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_19_pluck_list_default_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._pluck_list_default.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1171 * * * cpdef object pluck(object ind, object seqs, object default='__no__default__'): # <<<<<<<<<<<<<< * """ * plucks an element or several elements from each item in a sequence. */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_49pluck(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_pluck(PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_pluck *__pyx_optional_args) { PyObject *__pyx_v_default = ((PyObject *)__pyx_n_s_no__default); 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; int __pyx_t_8; __Pyx_RefNannySetupContext("pluck", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default = __pyx_optional_args->__pyx_default; } } /* "cytoolz/itertoolz.pyx":1195 * map * """ * if isinstance(ind, list): # <<<<<<<<<<<<<< * if default != no_default: * return _pluck_list_default(ind, seqs, default) */ __pyx_t_1 = PyList_Check(__pyx_v_ind); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":1196 * """ * if isinstance(ind, list): * if default != no_default: # <<<<<<<<<<<<<< * return _pluck_list_default(ind, seqs, default) * if PyList_GET_SIZE(ind) < 10: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_no_default); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_v_default, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1196, __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_ERR(0, 1196, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":1197 * if isinstance(ind, list): * if default != no_default: * return _pluck_list_default(ind, seqs, default) # <<<<<<<<<<<<<< * if PyList_GET_SIZE(ind) < 10: * return _pluck_list(ind, seqs) */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_ind); __Pyx_GIVEREF(__pyx_v_ind); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ind); __Pyx_INCREF(__pyx_v_seqs); __Pyx_GIVEREF(__pyx_v_seqs); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_seqs); __Pyx_INCREF(__pyx_v_default); __Pyx_GIVEREF(__pyx_v_default); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_default); __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__pluck_list_default), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1197, __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; /* "cytoolz/itertoolz.pyx":1196 * """ * if isinstance(ind, list): * if default != no_default: # <<<<<<<<<<<<<< * return _pluck_list_default(ind, seqs, default) * if PyList_GET_SIZE(ind) < 10: */ } /* "cytoolz/itertoolz.pyx":1198 * if default != no_default: * return _pluck_list_default(ind, seqs, default) * if PyList_GET_SIZE(ind) < 10: # <<<<<<<<<<<<<< * return _pluck_list(ind, seqs) * return map(itemgetter(*ind), seqs) */ __pyx_t_2 = ((PyList_GET_SIZE(__pyx_v_ind) < 10) != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":1199 * return _pluck_list_default(ind, seqs, default) * if PyList_GET_SIZE(ind) < 10: * return _pluck_list(ind, seqs) # <<<<<<<<<<<<<< * return map(itemgetter(*ind), seqs) * if default == no_default: */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_ind); __Pyx_GIVEREF(__pyx_v_ind); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ind); __Pyx_INCREF(__pyx_v_seqs); __Pyx_GIVEREF(__pyx_v_seqs); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_seqs); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__pluck_list), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1199, __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; /* "cytoolz/itertoolz.pyx":1198 * if default != no_default: * return _pluck_list_default(ind, seqs, default) * if PyList_GET_SIZE(ind) < 10: # <<<<<<<<<<<<<< * return _pluck_list(ind, seqs) * return map(itemgetter(*ind), seqs) */ } /* "cytoolz/itertoolz.pyx":1200 * if PyList_GET_SIZE(ind) < 10: * return _pluck_list(ind, seqs) * return map(itemgetter(*ind), seqs) # <<<<<<<<<<<<<< * if default == no_default: * return _pluck_index(ind, seqs) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_map); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_itemgetter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_ind); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1200, __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_t_6 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_7, __pyx_v_seqs}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1200, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_7, __pyx_v_seqs}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1200, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL; } __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_t_7); __Pyx_INCREF(__pyx_v_seqs); __Pyx_GIVEREF(__pyx_v_seqs); PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_seqs); __pyx_t_7 = 0; __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1200, __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; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1195 * map * """ * if isinstance(ind, list): # <<<<<<<<<<<<<< * if default != no_default: * return _pluck_list_default(ind, seqs, default) */ } /* "cytoolz/itertoolz.pyx":1201 * return _pluck_list(ind, seqs) * return map(itemgetter(*ind), seqs) * if default == no_default: # <<<<<<<<<<<<<< * return _pluck_index(ind, seqs) * return _pluck_index_default(ind, seqs, default) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_no_default); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyObject_RichCompare(__pyx_v_default, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1201, __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_ERR(0, 1201, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":1202 * return map(itemgetter(*ind), seqs) * if default == no_default: * return _pluck_index(ind, seqs) # <<<<<<<<<<<<<< * return _pluck_index_default(ind, seqs, default) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_ind); __Pyx_GIVEREF(__pyx_v_ind); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ind); __Pyx_INCREF(__pyx_v_seqs); __Pyx_GIVEREF(__pyx_v_seqs); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_seqs); __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__pluck_index), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1202, __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; /* "cytoolz/itertoolz.pyx":1201 * return _pluck_list(ind, seqs) * return map(itemgetter(*ind), seqs) * if default == no_default: # <<<<<<<<<<<<<< * return _pluck_index(ind, seqs) * return _pluck_index_default(ind, seqs, default) */ } /* "cytoolz/itertoolz.pyx":1203 * if default == no_default: * return _pluck_index(ind, seqs) * return _pluck_index_default(ind, seqs, default) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_ind); __Pyx_GIVEREF(__pyx_v_ind); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ind); __Pyx_INCREF(__pyx_v_seqs); __Pyx_GIVEREF(__pyx_v_seqs); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_seqs); __Pyx_INCREF(__pyx_v_default); __Pyx_GIVEREF(__pyx_v_default); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_default); __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__pluck_index_default), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1203, __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; /* "cytoolz/itertoolz.pyx":1171 * * * cpdef object pluck(object ind, object seqs, object default='__no__default__'): # <<<<<<<<<<<<<< * """ * plucks an element or several elements from each item in a sequence. */ /* 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_7); __Pyx_AddTraceback("cytoolz.itertoolz.pluck", __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_7cytoolz_9itertoolz_49pluck(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_48pluck[] = "pluck(ind, seqs, default='__no__default__')\n\n plucks an element or several elements from each item in a sequence.\n\n ``pluck`` maps ``itertoolz.get`` over a sequence and returns one or more\n elements of each item in the sequence.\n\n This is equivalent to running `map(curried.get(ind), seqs)`\n\n ``ind`` can be either a single string/index or a list of strings/indices.\n ``seqs`` should be sequence containing sequences or dicts.\n\n e.g.\n\n >>> data = [{'id': 1, 'name': 'Cheese'}, {'id': 2, 'name': 'Pies'}]\n >>> list(pluck('name', data))\n ['Cheese', 'Pies']\n >>> list(pluck([0, 1], [[1, 2, 3], [4, 5, 7]]))\n [(1, 2), (4, 5)]\n\n See Also:\n get\n map\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_49pluck = {"pluck", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9itertoolz_49pluck, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9itertoolz_48pluck}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_49pluck(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ind = 0; PyObject *__pyx_v_seqs = 0; PyObject *__pyx_v_default = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("pluck (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ind,&__pyx_n_s_seqs,&__pyx_n_s_default,0}; PyObject* values[3] = {0,0,0}; values[2] = ((PyObject *)__pyx_n_s_no__default); 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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ind)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seqs)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("pluck", 0, 2, 3, 1); __PYX_ERR(0, 1171, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__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, "pluck") < 0)) __PYX_ERR(0, 1171, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; 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_ind = values[0]; __pyx_v_seqs = values[1]; __pyx_v_default = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("pluck", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1171, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.pluck", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_48pluck(__pyx_self, __pyx_v_ind, __pyx_v_seqs, __pyx_v_default); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_48pluck(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ind, PyObject *__pyx_v_seqs, PyObject *__pyx_v_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_7cytoolz_9itertoolz_pluck __pyx_t_2; __Pyx_RefNannySetupContext("pluck", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.__pyx_default = __pyx_v_default; __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_pluck(__pyx_v_ind, __pyx_v_seqs, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.pluck", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1207 * * cdef class _getter_index: * def __cinit__(self, object ind): # <<<<<<<<<<<<<< * self.ind = ind * */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9itertoolz_13_getter_index_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9itertoolz_13_getter_index_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ind = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ind,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); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ind)) != 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, "__cinit__") < 0)) __PYX_ERR(0, 1207, __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_ind = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1207, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz._getter_index.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13_getter_index___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__getter_index *)__pyx_v_self), __pyx_v_ind); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9itertoolz_13_getter_index___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__getter_index *__pyx_v_self, PyObject *__pyx_v_ind) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/itertoolz.pyx":1208 * cdef class _getter_index: * def __cinit__(self, object ind): * self.ind = ind # <<<<<<<<<<<<<< * * def __call__(self, object seq): */ __Pyx_INCREF(__pyx_v_ind); __Pyx_GIVEREF(__pyx_v_ind); __Pyx_GOTREF(__pyx_v_self->ind); __Pyx_DECREF(__pyx_v_self->ind); __pyx_v_self->ind = __pyx_v_ind; /* "cytoolz/itertoolz.pyx":1207 * * cdef class _getter_index: * def __cinit__(self, object ind): # <<<<<<<<<<<<<< * self.ind = ind * */ /* function exit code */ __pyx_r = 0; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1210 * self.ind = ind * * def __call__(self, object seq): # <<<<<<<<<<<<<< * return seq[self.ind] * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13_getter_index_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13_getter_index_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_seq = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seq,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); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 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, "__call__") < 0)) __PYX_ERR(0, 1210, __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_seq = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1210, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz._getter_index.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13_getter_index_2__call__(((struct __pyx_obj_7cytoolz_9itertoolz__getter_index *)__pyx_v_self), __pyx_v_seq); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_13_getter_index_2__call__(struct __pyx_obj_7cytoolz_9itertoolz__getter_index *__pyx_v_self, PyObject *__pyx_v_seq) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__call__", 0); /* "cytoolz/itertoolz.pyx":1211 * * def __call__(self, object seq): * return seq[self.ind] # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_seq, __pyx_v_self->ind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1210 * self.ind = ind * * def __call__(self, object seq): # <<<<<<<<<<<<<< * return seq[self.ind] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._getter_index.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13_getter_index_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_13_getter_index_4__reduce_cython__[] = "_getter_index.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_13_getter_index_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_13_getter_index_5__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_13_getter_index_4__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_13_getter_index_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13_getter_index_4__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__getter_index *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_13_getter_index_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__getter_index *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._getter_index.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13_getter_index_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_13_getter_index_6__setstate_cython__[] = "_getter_index.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_13_getter_index_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_13_getter_index_7__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_13_getter_index_6__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_13_getter_index_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13_getter_index_6__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__getter_index *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_13_getter_index_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__getter_index *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._getter_index.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1215 * * cdef class _getter_list: * def __cinit__(self, list ind not None): # <<<<<<<<<<<<<< * self.ind = ind * self.n = len(ind) */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9itertoolz_12_getter_list_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9itertoolz_12_getter_list_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_ind = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ind,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); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ind)) != 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, "__cinit__") < 0)) __PYX_ERR(0, 1215, __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_ind = ((PyObject*)values[0]); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1215, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz._getter_list.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ind), (&PyList_Type), 0, "ind", 1))) __PYX_ERR(0, 1215, __pyx_L1_error) __pyx_r = __pyx_pf_7cytoolz_9itertoolz_12_getter_list___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__getter_list *)__pyx_v_self), __pyx_v_ind); /* function exit code */ goto __pyx_L0; __pyx_L1_error:; __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9itertoolz_12_getter_list___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__getter_list *__pyx_v_self, PyObject *__pyx_v_ind) { int __pyx_r; __Pyx_RefNannyDeclarations Py_ssize_t __pyx_t_1; __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/itertoolz.pyx":1216 * cdef class _getter_list: * def __cinit__(self, list ind not None): * self.ind = ind # <<<<<<<<<<<<<< * self.n = len(ind) * */ __Pyx_INCREF(__pyx_v_ind); __Pyx_GIVEREF(__pyx_v_ind); __Pyx_GOTREF(__pyx_v_self->ind); __Pyx_DECREF(__pyx_v_self->ind); __pyx_v_self->ind = __pyx_v_ind; /* "cytoolz/itertoolz.pyx":1217 * def __cinit__(self, list ind not None): * self.ind = ind * self.n = len(ind) # <<<<<<<<<<<<<< * * def __call__(self, object seq): */ __pyx_t_1 = PyList_GET_SIZE(__pyx_v_ind); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1217, __pyx_L1_error) __pyx_v_self->n = __pyx_t_1; /* "cytoolz/itertoolz.pyx":1215 * * cdef class _getter_list: * def __cinit__(self, list ind not None): # <<<<<<<<<<<<<< * self.ind = ind * self.n = len(ind) */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("cytoolz.itertoolz._getter_list.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1219 * self.n = len(ind) * * def __call__(self, object seq): # <<<<<<<<<<<<<< * cdef Py_ssize_t i * cdef tuple result */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_getter_list_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_getter_list_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_seq = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seq,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); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 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, "__call__") < 0)) __PYX_ERR(0, 1219, __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_seq = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1219, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz._getter_list.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_12_getter_list_2__call__(((struct __pyx_obj_7cytoolz_9itertoolz__getter_list *)__pyx_v_self), __pyx_v_seq); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_getter_list_2__call__(struct __pyx_obj_7cytoolz_9itertoolz__getter_list *__pyx_v_self, PyObject *__pyx_v_seq) { Py_ssize_t __pyx_v_i; PyObject *__pyx_v_result = 0; PyObject *__pyx_v_val = 0; 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; __Pyx_RefNannySetupContext("__call__", 0); /* "cytoolz/itertoolz.pyx":1223 * cdef tuple result * cdef object val * result = PyTuple_New(self.n) # <<<<<<<<<<<<<< * for i, val in enumerate(self.ind): * val = seq[val] */ __pyx_t_1 = PyTuple_New(__pyx_v_self->n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_result = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1224 * cdef object val * result = PyTuple_New(self.n) * for i, val in enumerate(self.ind): # <<<<<<<<<<<<<< * val = seq[val] * Py_INCREF(val) */ __pyx_t_2 = 0; __pyx_t_1 = __pyx_v_self->ind; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; for (;;) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1224, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; __pyx_v_i = __pyx_t_2; __pyx_t_2 = (__pyx_t_2 + 1); /* "cytoolz/itertoolz.pyx":1225 * result = PyTuple_New(self.n) * for i, val in enumerate(self.ind): * val = seq[val] # <<<<<<<<<<<<<< * Py_INCREF(val) * PyTuple_SET_ITEM(result, i, val) */ __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_seq, __pyx_v_val); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/itertoolz.pyx":1226 * for i, val in enumerate(self.ind): * val = seq[val] * Py_INCREF(val) # <<<<<<<<<<<<<< * PyTuple_SET_ITEM(result, i, val) * return result */ Py_INCREF(__pyx_v_val); /* "cytoolz/itertoolz.pyx":1227 * val = seq[val] * Py_INCREF(val) * PyTuple_SET_ITEM(result, i, val) # <<<<<<<<<<<<<< * return result * */ PyTuple_SET_ITEM(__pyx_v_result, __pyx_v_i, __pyx_v_val); /* "cytoolz/itertoolz.pyx":1224 * cdef object val * result = PyTuple_New(self.n) * for i, val in enumerate(self.ind): # <<<<<<<<<<<<<< * val = seq[val] * Py_INCREF(val) */ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1228 * Py_INCREF(val) * PyTuple_SET_ITEM(result, i, val) * return result # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_result); __pyx_r = __pyx_v_result; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1219 * self.n = len(ind) * * def __call__(self, object seq): # <<<<<<<<<<<<<< * cdef Py_ssize_t i * cdef tuple result */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("cytoolz.itertoolz._getter_list.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_result); __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_getter_list_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_12_getter_list_4__reduce_cython__[] = "_getter_list.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_12_getter_list_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_12_getter_list_5__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_12_getter_list_4__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_getter_list_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_12_getter_list_4__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__getter_list *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_getter_list_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__getter_list *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._getter_list.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_getter_list_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_12_getter_list_6__setstate_cython__[] = "_getter_list.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_12_getter_list_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_12_getter_list_7__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_12_getter_list_6__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_getter_list_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_12_getter_list_6__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__getter_list *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_getter_list_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__getter_list *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._getter_list.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1232 * * cdef class _getter_null: * def __call__(self, object seq): # <<<<<<<<<<<<<< * return () * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_getter_null_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_getter_null_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { CYTHON_UNUSED PyObject *__pyx_v_seq = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seq,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); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 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, "__call__") < 0)) __PYX_ERR(0, 1232, __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_seq = values[0]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1232, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz._getter_null.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_12_getter_null___call__(((struct __pyx_obj_7cytoolz_9itertoolz__getter_null *)__pyx_v_self), __pyx_v_seq); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_getter_null___call__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__getter_null *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_seq) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__call__", 0); /* "cytoolz/itertoolz.pyx":1233 * cdef class _getter_null: * def __call__(self, object seq): * return () # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_empty_tuple); __pyx_r = __pyx_empty_tuple; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1232 * * cdef class _getter_null: * def __call__(self, object seq): # <<<<<<<<<<<<<< * return () * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_getter_null_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_12_getter_null_2__reduce_cython__[] = "_getter_null.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_12_getter_null_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_12_getter_null_3__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_12_getter_null_2__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_getter_null_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_12_getter_null_2__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__getter_null *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_getter_null_2__reduce_cython__(struct __pyx_obj_7cytoolz_9itertoolz__getter_null *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; 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; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":5 * cdef object _dict * cdef bint use_setstate * state = () # <<<<<<<<<<<<<< * _dict = getattr(self, '__dict__', None) * if _dict is not None: */ __Pyx_INCREF(__pyx_empty_tuple); __pyx_v_state = __pyx_empty_tuple; /* "(tree fragment)":6 * cdef bint use_setstate * state = () * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<< * if _dict is not None: * state += (_dict,) */ __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__dict = __pyx_t_1; __pyx_t_1 = 0; /* "(tree fragment)":7 * state = () * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ __pyx_t_2 = (__pyx_v__dict != Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "(tree fragment)":8 * _dict = getattr(self, '__dict__', None) * if _dict is not None: * state += (_dict,) # <<<<<<<<<<<<<< * use_setstate = True * else: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v__dict); __Pyx_GIVEREF(__pyx_v__dict); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict); __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; /* "(tree fragment)":9 * if _dict is not None: * state += (_dict,) * use_setstate = True # <<<<<<<<<<<<<< * else: * use_setstate = False */ __pyx_v_use_setstate = 1; /* "(tree fragment)":7 * state = () * _dict = getattr(self, '__dict__', None) * if _dict is not None: # <<<<<<<<<<<<<< * state += (_dict,) * use_setstate = True */ goto __pyx_L3; } /* "(tree fragment)":11 * use_setstate = True * else: * use_setstate = False # <<<<<<<<<<<<<< * if use_setstate: * return __pyx_unpickle__getter_null, (type(self), 0xd41d8cd, None), state */ /*else*/ { __pyx_v_use_setstate = 0; } __pyx_L3:; /* "(tree fragment)":12 * else: * use_setstate = False * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle__getter_null, (type(self), 0xd41d8cd, None), state * else: */ __pyx_t_3 = (__pyx_v_use_setstate != 0); if (__pyx_t_3) { /* "(tree fragment)":13 * use_setstate = False * if use_setstate: * return __pyx_unpickle__getter_null, (type(self), 0xd41d8cd, None), state # <<<<<<<<<<<<<< * else: * return __pyx_unpickle__getter_null, (type(self), 0xd41d8cd, state) */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle__getter_null); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_222419149); __Pyx_GIVEREF(__pyx_int_222419149); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None); __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state); __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "(tree fragment)":12 * else: * use_setstate = False * if use_setstate: # <<<<<<<<<<<<<< * return __pyx_unpickle__getter_null, (type(self), 0xd41d8cd, None), state * else: */ } /* "(tree fragment)":15 * return __pyx_unpickle__getter_null, (type(self), 0xd41d8cd, None), state * else: * return __pyx_unpickle__getter_null, (type(self), 0xd41d8cd, state) # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle__getter_null__set_state(self, __pyx_state) */ /*else*/ { __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle__getter_null); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self)))); __Pyx_INCREF(__pyx_int_222419149); __Pyx_GIVEREF(__pyx_int_222419149); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149); __Pyx_INCREF(__pyx_v_state); __Pyx_GIVEREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state); __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __pyx_t_5 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("cytoolz.itertoolz._getter_null.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); __Pyx_XDECREF(__pyx_v__dict); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":16 * else: * return __pyx_unpickle__getter_null, (type(self), 0xd41d8cd, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle__getter_null__set_state(self, __pyx_state) */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_getter_null_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_12_getter_null_4__setstate_cython__[] = "_getter_null.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_12_getter_null_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_12_getter_null_5__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_12_getter_null_4__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_12_getter_null_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_12_getter_null_4__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__getter_null *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_12_getter_null_4__setstate_cython__(struct __pyx_obj_7cytoolz_9itertoolz__getter_null *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":17 * return __pyx_unpickle__getter_null, (type(self), 0xd41d8cd, state) * def __setstate_cython__(self, __pyx_state): * __pyx_unpickle__getter_null__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error) __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz___pyx_unpickle__getter_null__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle__getter_null, (type(self), 0xd41d8cd, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle__getter_null__set_state(self, __pyx_state) */ /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._getter_null.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1237 * * # TODO: benchmark getters (and compare against itemgetter) * cpdef object getter(object index): # <<<<<<<<<<<<<< * if isinstance(index, list): * if PyList_GET_SIZE(index) == 0: */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_51getter(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_getter(PyObject *__pyx_v_index, CYTHON_UNUSED int __pyx_skip_dispatch) { 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; __Pyx_RefNannySetupContext("getter", 0); /* "cytoolz/itertoolz.pyx":1238 * # TODO: benchmark getters (and compare against itemgetter) * cpdef object getter(object index): * if isinstance(index, list): # <<<<<<<<<<<<<< * if PyList_GET_SIZE(index) == 0: * return _getter_null() */ __pyx_t_1 = PyList_Check(__pyx_v_index); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":1239 * cpdef object getter(object index): * if isinstance(index, list): * if PyList_GET_SIZE(index) == 0: # <<<<<<<<<<<<<< * return _getter_null() * elif PyList_GET_SIZE(index) < 10: */ __pyx_t_2 = ((PyList_GET_SIZE(__pyx_v_index) == 0) != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":1240 * if isinstance(index, list): * if PyList_GET_SIZE(index) == 0: * return _getter_null() # <<<<<<<<<<<<<< * elif PyList_GET_SIZE(index) < 10: * return _getter_list(index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__getter_null)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1239 * cpdef object getter(object index): * if isinstance(index, list): * if PyList_GET_SIZE(index) == 0: # <<<<<<<<<<<<<< * return _getter_null() * elif PyList_GET_SIZE(index) < 10: */ } /* "cytoolz/itertoolz.pyx":1241 * if PyList_GET_SIZE(index) == 0: * return _getter_null() * elif PyList_GET_SIZE(index) < 10: # <<<<<<<<<<<<<< * return _getter_list(index) * return itemgetter(*index) */ __pyx_t_2 = ((PyList_GET_SIZE(__pyx_v_index) < 10) != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":1242 * return _getter_null() * elif PyList_GET_SIZE(index) < 10: * return _getter_list(index) # <<<<<<<<<<<<<< * return itemgetter(*index) * return _getter_index(index) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__getter_list), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1241 * if PyList_GET_SIZE(index) == 0: * return _getter_null() * elif PyList_GET_SIZE(index) < 10: # <<<<<<<<<<<<<< * return _getter_list(index) * return itemgetter(*index) */ } /* "cytoolz/itertoolz.pyx":1243 * elif PyList_GET_SIZE(index) < 10: * return _getter_list(index) * return itemgetter(*index) # <<<<<<<<<<<<<< * return _getter_index(index) * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_itemgetter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1243, __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_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1238 * # TODO: benchmark getters (and compare against itemgetter) * cpdef object getter(object index): * if isinstance(index, list): # <<<<<<<<<<<<<< * if PyList_GET_SIZE(index) == 0: * return _getter_null() */ } /* "cytoolz/itertoolz.pyx":1244 * return _getter_list(index) * return itemgetter(*index) * return _getter_index(index) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__getter_index), __pyx_v_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1237 * * # TODO: benchmark getters (and compare against itemgetter) * cpdef object getter(object index): # <<<<<<<<<<<<<< * if isinstance(index, list): * if PyList_GET_SIZE(index) == 0: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("cytoolz.itertoolz.getter", __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_7cytoolz_9itertoolz_51getter(PyObject *__pyx_self, PyObject *__pyx_v_index); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_50getter[] = "getter(index)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_51getter = {"getter", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_51getter, METH_O, __pyx_doc_7cytoolz_9itertoolz_50getter}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_51getter(PyObject *__pyx_self, PyObject *__pyx_v_index) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("getter (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_50getter(__pyx_self, ((PyObject *)__pyx_v_index)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_50getter(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_index) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("getter", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_getter(__pyx_v_index, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.getter", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1247 * * * cpdef object join(object leftkey, object leftseq, # <<<<<<<<<<<<<< * object rightkey, object rightseq, * object left_default='__no__default__', */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_53join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_join(PyObject *__pyx_v_leftkey, PyObject *__pyx_v_leftseq, PyObject *__pyx_v_rightkey, PyObject *__pyx_v_rightseq, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_join *__pyx_optional_args) { PyObject *__pyx_v_left_default = ((PyObject *)__pyx_n_s_no__default); PyObject *__pyx_v_right_default = ((PyObject *)__pyx_n_s_no__default); PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; __Pyx_RefNannySetupContext("join", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_left_default = __pyx_optional_args->left_default; if (__pyx_optional_args->__pyx_n > 1) { __pyx_v_right_default = __pyx_optional_args->right_default; } } } /* "cytoolz/itertoolz.pyx":1309 * >>> result = join(1, friends, 0, cities) # doctest: +SKIP * """ * if left_default == no_default and right_default == no_default: # <<<<<<<<<<<<<< * if callable(rightkey): * return _inner_join_key(leftkey, leftseq, rightkey, rightseq, */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_v_left_default, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1309, __pyx_L1_error) __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_ERR(0, 1309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_no_default); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_RichCompare(__pyx_v_right_default, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1309, __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_ERR(0, 1309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":1310 * """ * if left_default == no_default and right_default == no_default: * if callable(rightkey): # <<<<<<<<<<<<<< * return _inner_join_key(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) */ __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_rightkey); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1310, __pyx_L1_error) __pyx_t_4 = (__pyx_t_1 != 0); if (__pyx_t_4) { /* "cytoolz/itertoolz.pyx":1311 * if left_default == no_default and right_default == no_default: * if callable(rightkey): * return _inner_join_key(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * elif isinstance(rightkey, list): */ __Pyx_XDECREF(__pyx_r); /* "cytoolz/itertoolz.pyx":1312 * if callable(rightkey): * return _inner_join_key(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) # <<<<<<<<<<<<<< * elif isinstance(rightkey, list): * return _inner_join_indices(leftkey, leftseq, rightkey, rightseq, */ __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_leftkey); __Pyx_GIVEREF(__pyx_v_leftkey); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_leftkey); __Pyx_INCREF(__pyx_v_leftseq); __Pyx_GIVEREF(__pyx_v_leftseq); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_leftseq); __Pyx_INCREF(__pyx_v_rightkey); __Pyx_GIVEREF(__pyx_v_rightkey); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_rightkey); __Pyx_INCREF(__pyx_v_rightseq); __Pyx_GIVEREF(__pyx_v_rightseq); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_rightseq); __Pyx_INCREF(__pyx_v_left_default); __Pyx_GIVEREF(__pyx_v_left_default); PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_left_default); __Pyx_INCREF(__pyx_v_right_default); __Pyx_GIVEREF(__pyx_v_right_default); PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_right_default); /* "cytoolz/itertoolz.pyx":1311 * if left_default == no_default and right_default == no_default: * if callable(rightkey): * return _inner_join_key(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * elif isinstance(rightkey, list): */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__inner_join_key), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1311, __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; /* "cytoolz/itertoolz.pyx":1310 * """ * if left_default == no_default and right_default == no_default: * if callable(rightkey): # <<<<<<<<<<<<<< * return _inner_join_key(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) */ } /* "cytoolz/itertoolz.pyx":1313 * return _inner_join_key(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) * elif isinstance(rightkey, list): # <<<<<<<<<<<<<< * return _inner_join_indices(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) */ __pyx_t_4 = PyList_Check(__pyx_v_rightkey); __pyx_t_1 = (__pyx_t_4 != 0); if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":1314 * left_default, right_default) * elif isinstance(rightkey, list): * return _inner_join_indices(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * else: */ __Pyx_XDECREF(__pyx_r); /* "cytoolz/itertoolz.pyx":1315 * elif isinstance(rightkey, list): * return _inner_join_indices(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) # <<<<<<<<<<<<<< * else: * return _inner_join_index(leftkey, leftseq, rightkey, rightseq, */ __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_leftkey); __Pyx_GIVEREF(__pyx_v_leftkey); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_leftkey); __Pyx_INCREF(__pyx_v_leftseq); __Pyx_GIVEREF(__pyx_v_leftseq); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_leftseq); __Pyx_INCREF(__pyx_v_rightkey); __Pyx_GIVEREF(__pyx_v_rightkey); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_rightkey); __Pyx_INCREF(__pyx_v_rightseq); __Pyx_GIVEREF(__pyx_v_rightseq); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_rightseq); __Pyx_INCREF(__pyx_v_left_default); __Pyx_GIVEREF(__pyx_v_left_default); PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_left_default); __Pyx_INCREF(__pyx_v_right_default); __Pyx_GIVEREF(__pyx_v_right_default); PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_right_default); /* "cytoolz/itertoolz.pyx":1314 * left_default, right_default) * elif isinstance(rightkey, list): * return _inner_join_indices(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * else: */ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__inner_join_indices), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1314, __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; /* "cytoolz/itertoolz.pyx":1313 * return _inner_join_key(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) * elif isinstance(rightkey, list): # <<<<<<<<<<<<<< * return _inner_join_indices(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) */ } /* "cytoolz/itertoolz.pyx":1317 * left_default, right_default) * else: * return _inner_join_index(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * elif left_default != no_default and right_default == no_default: */ /*else*/ { __Pyx_XDECREF(__pyx_r); /* "cytoolz/itertoolz.pyx":1318 * else: * return _inner_join_index(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) # <<<<<<<<<<<<<< * elif left_default != no_default and right_default == no_default: * if callable(rightkey): */ __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_leftkey); __Pyx_GIVEREF(__pyx_v_leftkey); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_leftkey); __Pyx_INCREF(__pyx_v_leftseq); __Pyx_GIVEREF(__pyx_v_leftseq); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_leftseq); __Pyx_INCREF(__pyx_v_rightkey); __Pyx_GIVEREF(__pyx_v_rightkey); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_rightkey); __Pyx_INCREF(__pyx_v_rightseq); __Pyx_GIVEREF(__pyx_v_rightseq); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_rightseq); __Pyx_INCREF(__pyx_v_left_default); __Pyx_GIVEREF(__pyx_v_left_default); PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_left_default); __Pyx_INCREF(__pyx_v_right_default); __Pyx_GIVEREF(__pyx_v_right_default); PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_right_default); /* "cytoolz/itertoolz.pyx":1317 * left_default, right_default) * else: * return _inner_join_index(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * elif left_default != no_default and right_default == no_default: */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__inner_join_index), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1317, __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; } /* "cytoolz/itertoolz.pyx":1309 * >>> result = join(1, friends, 0, cities) # doctest: +SKIP * """ * if left_default == no_default and right_default == no_default: # <<<<<<<<<<<<<< * if callable(rightkey): * return _inner_join_key(leftkey, leftseq, rightkey, rightseq, */ } /* "cytoolz/itertoolz.pyx":1319 * return _inner_join_index(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) * elif left_default != no_default and right_default == no_default: # <<<<<<<<<<<<<< * if callable(rightkey): * return _right_outer_join_key(leftkey, leftseq, rightkey, rightseq, */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_no_default); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_RichCompare(__pyx_v_left_default, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1319, __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_ERR(0, 1319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L7_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_v_right_default, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1319, __pyx_L1_error) __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_ERR(0, 1319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_4; __pyx_L7_bool_binop_done:; if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":1320 * left_default, right_default) * elif left_default != no_default and right_default == no_default: * if callable(rightkey): # <<<<<<<<<<<<<< * return _right_outer_join_key(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) */ __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_rightkey); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1320, __pyx_L1_error) __pyx_t_4 = (__pyx_t_1 != 0); if (__pyx_t_4) { /* "cytoolz/itertoolz.pyx":1321 * elif left_default != no_default and right_default == no_default: * if callable(rightkey): * return _right_outer_join_key(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * elif isinstance(rightkey, list): */ __Pyx_XDECREF(__pyx_r); /* "cytoolz/itertoolz.pyx":1322 * if callable(rightkey): * return _right_outer_join_key(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) # <<<<<<<<<<<<<< * elif isinstance(rightkey, list): * return _right_outer_join_indices(leftkey, leftseq, rightkey, rightseq, */ __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_leftkey); __Pyx_GIVEREF(__pyx_v_leftkey); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_leftkey); __Pyx_INCREF(__pyx_v_leftseq); __Pyx_GIVEREF(__pyx_v_leftseq); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_leftseq); __Pyx_INCREF(__pyx_v_rightkey); __Pyx_GIVEREF(__pyx_v_rightkey); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_rightkey); __Pyx_INCREF(__pyx_v_rightseq); __Pyx_GIVEREF(__pyx_v_rightseq); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_rightseq); __Pyx_INCREF(__pyx_v_left_default); __Pyx_GIVEREF(__pyx_v_left_default); PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_left_default); __Pyx_INCREF(__pyx_v_right_default); __Pyx_GIVEREF(__pyx_v_right_default); PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_right_default); /* "cytoolz/itertoolz.pyx":1321 * elif left_default != no_default and right_default == no_default: * if callable(rightkey): * return _right_outer_join_key(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * elif isinstance(rightkey, list): */ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__right_outer_join_key), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1321, __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; /* "cytoolz/itertoolz.pyx":1320 * left_default, right_default) * elif left_default != no_default and right_default == no_default: * if callable(rightkey): # <<<<<<<<<<<<<< * return _right_outer_join_key(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) */ } /* "cytoolz/itertoolz.pyx":1323 * return _right_outer_join_key(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) * elif isinstance(rightkey, list): # <<<<<<<<<<<<<< * return _right_outer_join_indices(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) */ __pyx_t_4 = PyList_Check(__pyx_v_rightkey); __pyx_t_1 = (__pyx_t_4 != 0); if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":1324 * left_default, right_default) * elif isinstance(rightkey, list): * return _right_outer_join_indices(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * else: */ __Pyx_XDECREF(__pyx_r); /* "cytoolz/itertoolz.pyx":1325 * elif isinstance(rightkey, list): * return _right_outer_join_indices(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) # <<<<<<<<<<<<<< * else: * return _right_outer_join_index(leftkey, leftseq, rightkey, rightseq, */ __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_leftkey); __Pyx_GIVEREF(__pyx_v_leftkey); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_leftkey); __Pyx_INCREF(__pyx_v_leftseq); __Pyx_GIVEREF(__pyx_v_leftseq); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_leftseq); __Pyx_INCREF(__pyx_v_rightkey); __Pyx_GIVEREF(__pyx_v_rightkey); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_rightkey); __Pyx_INCREF(__pyx_v_rightseq); __Pyx_GIVEREF(__pyx_v_rightseq); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_rightseq); __Pyx_INCREF(__pyx_v_left_default); __Pyx_GIVEREF(__pyx_v_left_default); PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_left_default); __Pyx_INCREF(__pyx_v_right_default); __Pyx_GIVEREF(__pyx_v_right_default); PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_right_default); /* "cytoolz/itertoolz.pyx":1324 * left_default, right_default) * elif isinstance(rightkey, list): * return _right_outer_join_indices(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * else: */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__right_outer_join_indices), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1324, __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; /* "cytoolz/itertoolz.pyx":1323 * return _right_outer_join_key(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) * elif isinstance(rightkey, list): # <<<<<<<<<<<<<< * return _right_outer_join_indices(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) */ } /* "cytoolz/itertoolz.pyx":1327 * left_default, right_default) * else: * return _right_outer_join_index(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * elif left_default == no_default and right_default != no_default: */ /*else*/ { __Pyx_XDECREF(__pyx_r); /* "cytoolz/itertoolz.pyx":1328 * else: * return _right_outer_join_index(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) # <<<<<<<<<<<<<< * elif left_default == no_default and right_default != no_default: * if callable(rightkey): */ __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_leftkey); __Pyx_GIVEREF(__pyx_v_leftkey); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_leftkey); __Pyx_INCREF(__pyx_v_leftseq); __Pyx_GIVEREF(__pyx_v_leftseq); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_leftseq); __Pyx_INCREF(__pyx_v_rightkey); __Pyx_GIVEREF(__pyx_v_rightkey); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_rightkey); __Pyx_INCREF(__pyx_v_rightseq); __Pyx_GIVEREF(__pyx_v_rightseq); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_rightseq); __Pyx_INCREF(__pyx_v_left_default); __Pyx_GIVEREF(__pyx_v_left_default); PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_left_default); __Pyx_INCREF(__pyx_v_right_default); __Pyx_GIVEREF(__pyx_v_right_default); PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_right_default); /* "cytoolz/itertoolz.pyx":1327 * left_default, right_default) * else: * return _right_outer_join_index(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * elif left_default == no_default and right_default != no_default: */ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__right_outer_join_index), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1327, __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; } /* "cytoolz/itertoolz.pyx":1319 * return _inner_join_index(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) * elif left_default != no_default and right_default == no_default: # <<<<<<<<<<<<<< * if callable(rightkey): * return _right_outer_join_key(leftkey, leftseq, rightkey, rightseq, */ } /* "cytoolz/itertoolz.pyx":1329 * return _right_outer_join_index(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) * elif left_default == no_default and right_default != no_default: # <<<<<<<<<<<<<< * if callable(rightkey): * return _left_outer_join_key(leftkey, leftseq, rightkey, rightseq, */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_RichCompare(__pyx_v_left_default, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1329, __pyx_L1_error) __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_ERR(0, 1329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { } else { __pyx_t_1 = __pyx_t_4; goto __pyx_L10_bool_binop_done; } __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_no_default); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_RichCompare(__pyx_v_right_default, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1329, __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_ERR(0, 1329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_1 = __pyx_t_4; __pyx_L10_bool_binop_done:; if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":1330 * left_default, right_default) * elif left_default == no_default and right_default != no_default: * if callable(rightkey): # <<<<<<<<<<<<<< * return _left_outer_join_key(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) */ __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_rightkey); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1330, __pyx_L1_error) __pyx_t_4 = (__pyx_t_1 != 0); if (__pyx_t_4) { /* "cytoolz/itertoolz.pyx":1331 * elif left_default == no_default and right_default != no_default: * if callable(rightkey): * return _left_outer_join_key(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * elif isinstance(rightkey, list): */ __Pyx_XDECREF(__pyx_r); /* "cytoolz/itertoolz.pyx":1332 * if callable(rightkey): * return _left_outer_join_key(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) # <<<<<<<<<<<<<< * elif isinstance(rightkey, list): * return _left_outer_join_indices(leftkey, leftseq, rightkey, rightseq, */ __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_leftkey); __Pyx_GIVEREF(__pyx_v_leftkey); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_leftkey); __Pyx_INCREF(__pyx_v_leftseq); __Pyx_GIVEREF(__pyx_v_leftseq); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_leftseq); __Pyx_INCREF(__pyx_v_rightkey); __Pyx_GIVEREF(__pyx_v_rightkey); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_rightkey); __Pyx_INCREF(__pyx_v_rightseq); __Pyx_GIVEREF(__pyx_v_rightseq); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_rightseq); __Pyx_INCREF(__pyx_v_left_default); __Pyx_GIVEREF(__pyx_v_left_default); PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_left_default); __Pyx_INCREF(__pyx_v_right_default); __Pyx_GIVEREF(__pyx_v_right_default); PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_right_default); /* "cytoolz/itertoolz.pyx":1331 * elif left_default == no_default and right_default != no_default: * if callable(rightkey): * return _left_outer_join_key(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * elif isinstance(rightkey, list): */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__left_outer_join_key), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1331, __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; /* "cytoolz/itertoolz.pyx":1330 * left_default, right_default) * elif left_default == no_default and right_default != no_default: * if callable(rightkey): # <<<<<<<<<<<<<< * return _left_outer_join_key(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) */ } /* "cytoolz/itertoolz.pyx":1333 * return _left_outer_join_key(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) * elif isinstance(rightkey, list): # <<<<<<<<<<<<<< * return _left_outer_join_indices(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) */ __pyx_t_4 = PyList_Check(__pyx_v_rightkey); __pyx_t_1 = (__pyx_t_4 != 0); if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":1334 * left_default, right_default) * elif isinstance(rightkey, list): * return _left_outer_join_indices(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * else: */ __Pyx_XDECREF(__pyx_r); /* "cytoolz/itertoolz.pyx":1335 * elif isinstance(rightkey, list): * return _left_outer_join_indices(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) # <<<<<<<<<<<<<< * else: * return _left_outer_join_index(leftkey, leftseq, rightkey, rightseq, */ __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_leftkey); __Pyx_GIVEREF(__pyx_v_leftkey); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_leftkey); __Pyx_INCREF(__pyx_v_leftseq); __Pyx_GIVEREF(__pyx_v_leftseq); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_leftseq); __Pyx_INCREF(__pyx_v_rightkey); __Pyx_GIVEREF(__pyx_v_rightkey); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_rightkey); __Pyx_INCREF(__pyx_v_rightseq); __Pyx_GIVEREF(__pyx_v_rightseq); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_rightseq); __Pyx_INCREF(__pyx_v_left_default); __Pyx_GIVEREF(__pyx_v_left_default); PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_left_default); __Pyx_INCREF(__pyx_v_right_default); __Pyx_GIVEREF(__pyx_v_right_default); PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_right_default); /* "cytoolz/itertoolz.pyx":1334 * left_default, right_default) * elif isinstance(rightkey, list): * return _left_outer_join_indices(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * else: */ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__left_outer_join_indices), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1334, __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; /* "cytoolz/itertoolz.pyx":1333 * return _left_outer_join_key(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) * elif isinstance(rightkey, list): # <<<<<<<<<<<<<< * return _left_outer_join_indices(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) */ } /* "cytoolz/itertoolz.pyx":1337 * left_default, right_default) * else: * return _left_outer_join_index(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * else: */ /*else*/ { __Pyx_XDECREF(__pyx_r); /* "cytoolz/itertoolz.pyx":1338 * else: * return _left_outer_join_index(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) # <<<<<<<<<<<<<< * else: * if callable(rightkey): */ __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_leftkey); __Pyx_GIVEREF(__pyx_v_leftkey); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_leftkey); __Pyx_INCREF(__pyx_v_leftseq); __Pyx_GIVEREF(__pyx_v_leftseq); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_leftseq); __Pyx_INCREF(__pyx_v_rightkey); __Pyx_GIVEREF(__pyx_v_rightkey); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_rightkey); __Pyx_INCREF(__pyx_v_rightseq); __Pyx_GIVEREF(__pyx_v_rightseq); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_rightseq); __Pyx_INCREF(__pyx_v_left_default); __Pyx_GIVEREF(__pyx_v_left_default); PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_left_default); __Pyx_INCREF(__pyx_v_right_default); __Pyx_GIVEREF(__pyx_v_right_default); PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_right_default); /* "cytoolz/itertoolz.pyx":1337 * left_default, right_default) * else: * return _left_outer_join_index(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * else: */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__left_outer_join_index), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1337, __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; } /* "cytoolz/itertoolz.pyx":1329 * return _right_outer_join_index(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) * elif left_default == no_default and right_default != no_default: # <<<<<<<<<<<<<< * if callable(rightkey): * return _left_outer_join_key(leftkey, leftseq, rightkey, rightseq, */ } /* "cytoolz/itertoolz.pyx":1340 * left_default, right_default) * else: * if callable(rightkey): # <<<<<<<<<<<<<< * return _outer_join_key(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) */ /*else*/ { __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_rightkey); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1340, __pyx_L1_error) __pyx_t_4 = (__pyx_t_1 != 0); if (__pyx_t_4) { /* "cytoolz/itertoolz.pyx":1341 * else: * if callable(rightkey): * return _outer_join_key(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * elif isinstance(rightkey, list): */ __Pyx_XDECREF(__pyx_r); /* "cytoolz/itertoolz.pyx":1342 * if callable(rightkey): * return _outer_join_key(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) # <<<<<<<<<<<<<< * elif isinstance(rightkey, list): * return _outer_join_indices(leftkey, leftseq, rightkey, rightseq, */ __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_leftkey); __Pyx_GIVEREF(__pyx_v_leftkey); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_leftkey); __Pyx_INCREF(__pyx_v_leftseq); __Pyx_GIVEREF(__pyx_v_leftseq); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_leftseq); __Pyx_INCREF(__pyx_v_rightkey); __Pyx_GIVEREF(__pyx_v_rightkey); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_rightkey); __Pyx_INCREF(__pyx_v_rightseq); __Pyx_GIVEREF(__pyx_v_rightseq); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_rightseq); __Pyx_INCREF(__pyx_v_left_default); __Pyx_GIVEREF(__pyx_v_left_default); PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_left_default); __Pyx_INCREF(__pyx_v_right_default); __Pyx_GIVEREF(__pyx_v_right_default); PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_right_default); /* "cytoolz/itertoolz.pyx":1341 * else: * if callable(rightkey): * return _outer_join_key(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * elif isinstance(rightkey, list): */ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__outer_join_key), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1341, __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; /* "cytoolz/itertoolz.pyx":1340 * left_default, right_default) * else: * if callable(rightkey): # <<<<<<<<<<<<<< * return _outer_join_key(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) */ } /* "cytoolz/itertoolz.pyx":1343 * return _outer_join_key(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) * elif isinstance(rightkey, list): # <<<<<<<<<<<<<< * return _outer_join_indices(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) */ __pyx_t_4 = PyList_Check(__pyx_v_rightkey); __pyx_t_1 = (__pyx_t_4 != 0); if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":1344 * left_default, right_default) * elif isinstance(rightkey, list): * return _outer_join_indices(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * else: */ __Pyx_XDECREF(__pyx_r); /* "cytoolz/itertoolz.pyx":1345 * elif isinstance(rightkey, list): * return _outer_join_indices(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) # <<<<<<<<<<<<<< * else: * return _outer_join_index(leftkey, leftseq, rightkey, rightseq, */ __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_leftkey); __Pyx_GIVEREF(__pyx_v_leftkey); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_leftkey); __Pyx_INCREF(__pyx_v_leftseq); __Pyx_GIVEREF(__pyx_v_leftseq); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_leftseq); __Pyx_INCREF(__pyx_v_rightkey); __Pyx_GIVEREF(__pyx_v_rightkey); PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_rightkey); __Pyx_INCREF(__pyx_v_rightseq); __Pyx_GIVEREF(__pyx_v_rightseq); PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_rightseq); __Pyx_INCREF(__pyx_v_left_default); __Pyx_GIVEREF(__pyx_v_left_default); PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_left_default); __Pyx_INCREF(__pyx_v_right_default); __Pyx_GIVEREF(__pyx_v_right_default); PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_right_default); /* "cytoolz/itertoolz.pyx":1344 * left_default, right_default) * elif isinstance(rightkey, list): * return _outer_join_indices(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * else: */ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__outer_join_indices), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1344, __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; /* "cytoolz/itertoolz.pyx":1343 * return _outer_join_key(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) * elif isinstance(rightkey, list): # <<<<<<<<<<<<<< * return _outer_join_indices(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) */ } /* "cytoolz/itertoolz.pyx":1347 * left_default, right_default) * else: * return _outer_join_index(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * */ /*else*/ { __Pyx_XDECREF(__pyx_r); /* "cytoolz/itertoolz.pyx":1348 * else: * return _outer_join_index(leftkey, leftseq, rightkey, rightseq, * left_default, right_default) # <<<<<<<<<<<<<< * * cdef class _join: */ __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_leftkey); __Pyx_GIVEREF(__pyx_v_leftkey); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_leftkey); __Pyx_INCREF(__pyx_v_leftseq); __Pyx_GIVEREF(__pyx_v_leftseq); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_leftseq); __Pyx_INCREF(__pyx_v_rightkey); __Pyx_GIVEREF(__pyx_v_rightkey); PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_rightkey); __Pyx_INCREF(__pyx_v_rightseq); __Pyx_GIVEREF(__pyx_v_rightseq); PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_rightseq); __Pyx_INCREF(__pyx_v_left_default); __Pyx_GIVEREF(__pyx_v_left_default); PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_left_default); __Pyx_INCREF(__pyx_v_right_default); __Pyx_GIVEREF(__pyx_v_right_default); PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_right_default); /* "cytoolz/itertoolz.pyx":1347 * left_default, right_default) * else: * return _outer_join_index(leftkey, leftseq, rightkey, rightseq, # <<<<<<<<<<<<<< * left_default, right_default) * */ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__outer_join_index), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1347, __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; } } /* "cytoolz/itertoolz.pyx":1247 * * * cpdef object join(object leftkey, object leftseq, # <<<<<<<<<<<<<< * object rightkey, object rightseq, * object left_default='__no__default__', */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.itertoolz.join", __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_7cytoolz_9itertoolz_53join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_52join[] = "join(leftkey, leftseq, rightkey, rightseq, left_default='__no__default__', right_default='__no__default__')\n\n Join two sequences on common attributes\n\n This is a semi-streaming operation. The LEFT sequence is fully evaluated\n and placed into memory. The RIGHT sequence is evaluated lazily and so can\n be arbitrarily large.\n (Note: If right_default is defined, then unique keys of rightseq\n will also be stored in memory.)\n\n >>> friends = [('Alice', 'Edith'),\n ... ('Alice', 'Zhao'),\n ... ('Edith', 'Alice'),\n ... ('Zhao', 'Alice'),\n ... ('Zhao', 'Edith')]\n\n >>> cities = [('Alice', 'NYC'),\n ... ('Alice', 'Chicago'),\n ... ('Dan', 'Syndey'),\n ... ('Edith', 'Paris'),\n ... ('Edith', 'Berlin'),\n ... ('Zhao', 'Shanghai')]\n\n >>> # Vacation opportunities\n >>> # In what cities do people have friends?\n >>> result = join(second, friends,\n ... first, cities)\n >>> for ((a, b), (c, d)) in sorted(unique(result)):\n ... print((a, d))\n ('Alice', 'Berlin')\n ('Alice', 'Paris')\n ('Alice', 'Shanghai')\n ('Edith', 'Chicago')\n ('Edith', 'NYC')\n ('Zhao', 'Chicago')\n ('Zhao', 'NYC')\n ('Zhao', 'Berlin')\n ('Zhao', 'Paris')\n\n Specify outer joins with keyword arguments ``left_default`` and/or\n ``right_default``. Here is a full outer join in which unmatched elements\n are paired with None.\n\n >>> identity = lambda x: x\n >>> list(join(identity, [1, 2, 3],\n ... identity, [2, 3, 4],\n ... left_default=None, right_default=None))\n [(2, 2), (3, 3), (None, 4), (1, None)]\n\n Usually the key arguments are callables to be applied to the sequences. If\n the keys are not obviously callable then it is assumed that indexing was\n intended, e.g. the following is a legal change.\n The join is implemented as a"" hash join and the keys of leftseq must be\n hashable. Additionally, if right_default is defined, then keys of rightseq\n must also be hashable.\n\n >>> # result = join(second, friends, first, cities)\n >>> result = join(1, friends, 0, cities) # doctest: +SKIP\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_53join = {"join", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9itertoolz_53join, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9itertoolz_52join}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_53join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_leftkey = 0; PyObject *__pyx_v_leftseq = 0; PyObject *__pyx_v_rightkey = 0; PyObject *__pyx_v_rightseq = 0; PyObject *__pyx_v_left_default = 0; PyObject *__pyx_v_right_default = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("join (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_leftkey,&__pyx_n_s_leftseq,&__pyx_n_s_rightkey,&__pyx_n_s_rightseq,&__pyx_n_s_left_default,&__pyx_n_s_right_default,0}; PyObject* values[6] = {0,0,0,0,0,0}; values[4] = ((PyObject *)__pyx_n_s_no__default); values[5] = ((PyObject *)__pyx_n_s_no__default); 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); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leftkey)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leftseq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("join", 0, 4, 6, 1); __PYX_ERR(0, 1247, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rightkey)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("join", 0, 4, 6, 2); __PYX_ERR(0, 1247, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rightseq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("join", 0, 4, 6, 3); __PYX_ERR(0, 1247, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_left_default); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_right_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, "join") < 0)) __PYX_ERR(0, 1247, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 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_leftkey = values[0]; __pyx_v_leftseq = values[1]; __pyx_v_rightkey = values[2]; __pyx_v_rightseq = values[3]; __pyx_v_left_default = values[4]; __pyx_v_right_default = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("join", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1247, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.join", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_52join(__pyx_self, __pyx_v_leftkey, __pyx_v_leftseq, __pyx_v_rightkey, __pyx_v_rightseq, __pyx_v_left_default, __pyx_v_right_default); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_52join(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_leftkey, PyObject *__pyx_v_leftseq, PyObject *__pyx_v_rightkey, PyObject *__pyx_v_rightseq, PyObject *__pyx_v_left_default, PyObject *__pyx_v_right_default) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_7cytoolz_9itertoolz_join __pyx_t_2; __Pyx_RefNannySetupContext("join", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 2; __pyx_t_2.left_default = __pyx_v_left_default; __pyx_t_2.right_default = __pyx_v_right_default; __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_join(__pyx_v_leftkey, __pyx_v_leftseq, __pyx_v_rightkey, __pyx_v_rightseq, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.join", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1351 * * cdef class _join: * def __cinit__(self, # <<<<<<<<<<<<<< * object leftkey, object leftseq, * object rightkey, object rightseq, */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9itertoolz_5_join_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9itertoolz_5_join_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_leftkey = 0; PyObject *__pyx_v_leftseq = 0; PyObject *__pyx_v_rightkey = 0; PyObject *__pyx_v_rightseq = 0; PyObject *__pyx_v_left_default = 0; PyObject *__pyx_v_right_default = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_leftkey,&__pyx_n_s_leftseq,&__pyx_n_s_rightkey,&__pyx_n_s_rightseq,&__pyx_n_s_left_default,&__pyx_n_s_right_default,0}; PyObject* values[6] = {0,0,0,0,0,0}; values[4] = __pyx_k__37; values[5] = __pyx_k__38; 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); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leftkey)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_leftseq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 4, 6, 1); __PYX_ERR(0, 1351, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rightkey)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 4, 6, 2); __PYX_ERR(0, 1351, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rightseq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 4, 6, 3); __PYX_ERR(0, 1351, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_left_default); if (value) { values[4] = value; kw_args--; } } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_right_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, "__cinit__") < 0)) __PYX_ERR(0, 1351, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 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_leftkey = values[0]; __pyx_v_leftseq = values[1]; __pyx_v_rightkey = values[2]; __pyx_v_rightseq = values[3]; __pyx_v_left_default = values[4]; __pyx_v_right_default = values[5]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1351, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz._join.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_5_join___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__join *)__pyx_v_self), __pyx_v_leftkey, __pyx_v_leftseq, __pyx_v_rightkey, __pyx_v_rightseq, __pyx_v_left_default, __pyx_v_right_default); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9itertoolz_5_join___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__join *__pyx_v_self, PyObject *__pyx_v_leftkey, PyObject *__pyx_v_leftseq, PyObject *__pyx_v_rightkey, PyObject *__pyx_v_rightseq, PyObject *__pyx_v_left_default, PyObject *__pyx_v_right_default) { int __pyx_r; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; Py_ssize_t __pyx_t_4; __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/itertoolz.pyx":1356 * object left_default=no_default, * object right_default=no_default): * self.left_default = left_default # <<<<<<<<<<<<<< * self.right_default = right_default * */ __Pyx_INCREF(__pyx_v_left_default); __Pyx_GIVEREF(__pyx_v_left_default); __Pyx_GOTREF(__pyx_v_self->left_default); __Pyx_DECREF(__pyx_v_self->left_default); __pyx_v_self->left_default = __pyx_v_left_default; /* "cytoolz/itertoolz.pyx":1357 * object right_default=no_default): * self.left_default = left_default * self.right_default = right_default # <<<<<<<<<<<<<< * * self._rightkey = rightkey */ __Pyx_INCREF(__pyx_v_right_default); __Pyx_GIVEREF(__pyx_v_right_default); __Pyx_GOTREF(__pyx_v_self->right_default); __Pyx_DECREF(__pyx_v_self->right_default); __pyx_v_self->right_default = __pyx_v_right_default; /* "cytoolz/itertoolz.pyx":1359 * self.right_default = right_default * * self._rightkey = rightkey # <<<<<<<<<<<<<< * self.rightseq = iter(rightseq) * if isinstance(rightkey, list): */ __Pyx_INCREF(__pyx_v_rightkey); __Pyx_GIVEREF(__pyx_v_rightkey); __Pyx_GOTREF(__pyx_v_self->_rightkey); __Pyx_DECREF(__pyx_v_self->_rightkey); __pyx_v_self->_rightkey = __pyx_v_rightkey; /* "cytoolz/itertoolz.pyx":1360 * * self._rightkey = rightkey * self.rightseq = iter(rightseq) # <<<<<<<<<<<<<< * if isinstance(rightkey, list): * self.N = len(rightkey) */ __pyx_t_1 = PyObject_GetIter(__pyx_v_rightseq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->rightseq); __Pyx_DECREF(__pyx_v_self->rightseq); __pyx_v_self->rightseq = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1361 * self._rightkey = rightkey * self.rightseq = iter(rightseq) * if isinstance(rightkey, list): # <<<<<<<<<<<<<< * self.N = len(rightkey) * */ __pyx_t_2 = PyList_Check(__pyx_v_rightkey); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "cytoolz/itertoolz.pyx":1362 * self.rightseq = iter(rightseq) * if isinstance(rightkey, list): * self.N = len(rightkey) # <<<<<<<<<<<<<< * * self.d = groupby(leftkey, leftseq) */ __pyx_t_4 = PyObject_Length(__pyx_v_rightkey); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1362, __pyx_L1_error) __pyx_v_self->N = __pyx_t_4; /* "cytoolz/itertoolz.pyx":1361 * self._rightkey = rightkey * self.rightseq = iter(rightseq) * if isinstance(rightkey, list): # <<<<<<<<<<<<<< * self.N = len(rightkey) * */ } /* "cytoolz/itertoolz.pyx":1364 * self.N = len(rightkey) * * self.d = groupby(leftkey, leftseq) # <<<<<<<<<<<<<< * self.seen_keys = set() * self.matches = [] */ __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_groupby(__pyx_v_leftkey, __pyx_v_leftseq, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->d); __Pyx_DECREF(__pyx_v_self->d); __pyx_v_self->d = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1365 * * self.d = groupby(leftkey, leftseq) * self.seen_keys = set() # <<<<<<<<<<<<<< * self.matches = [] * self.right = None */ __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->seen_keys); __Pyx_DECREF(__pyx_v_self->seen_keys); __pyx_v_self->seen_keys = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1366 * self.d = groupby(leftkey, leftseq) * self.seen_keys = set() * self.matches = [] # <<<<<<<<<<<<<< * self.right = None * */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(__pyx_v_self->matches); __Pyx_DECREF(__pyx_v_self->matches); __pyx_v_self->matches = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1367 * self.seen_keys = set() * self.matches = [] * self.right = None # <<<<<<<<<<<<<< * * self.is_rightseq_exhausted = False */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); __Pyx_GOTREF(__pyx_v_self->right); __Pyx_DECREF(__pyx_v_self->right); __pyx_v_self->right = Py_None; /* "cytoolz/itertoolz.pyx":1369 * self.right = None * * self.is_rightseq_exhausted = False # <<<<<<<<<<<<<< * * def __iter__(self): */ __pyx_v_self->is_rightseq_exhausted = 0; /* "cytoolz/itertoolz.pyx":1351 * * cdef class _join: * def __cinit__(self, # <<<<<<<<<<<<<< * object leftkey, object leftseq, * object rightkey, object rightseq, */ /* function exit code */ __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._join.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1371 * self.is_rightseq_exhausted = False * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_5_join_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz__join *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_5_join_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__join *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* "cytoolz/itertoolz.pyx":1372 * * def __iter__(self): * return self # <<<<<<<<<<<<<< * * cdef object rightkey(self): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(((PyObject *)__pyx_v_self)); __pyx_r = ((PyObject *)__pyx_v_self); goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1371 * self.is_rightseq_exhausted = False * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1374 * return self * * cdef object rightkey(self): # <<<<<<<<<<<<<< * pass * */ static PyObject *__pyx_f_7cytoolz_9itertoolz_5_join_rightkey(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__join *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("rightkey", 0); /* function exit code */ __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_5_join_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_5_join_4__reduce_cython__[] = "_join.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_5_join_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_5_join_5__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_5_join_4__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_5_join_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_5_join_4__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__join *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_5_join_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__join *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._join.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_5_join_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_5_join_6__setstate_cython__[] = "_join.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_5_join_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_5_join_7__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_5_join_6__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_5_join_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_5_join_6__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__join *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_5_join_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__join *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._join.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1379 * * cdef class _right_outer_join(_join): * def __next__(self): # <<<<<<<<<<<<<< * cdef PyObject *obj * if self.i == PyList_GET_SIZE(self.matches): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_1__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_1__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_17_right_outer_join___next__(((struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_right_outer_join___next__(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join *__pyx_v_self) { PyObject *__pyx_v_obj; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_match = 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; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":1381 * def __next__(self): * cdef PyObject *obj * if self.i == PyList_GET_SIZE(self.matches): # <<<<<<<<<<<<<< * self.right = next(self.rightseq) * key = self.rightkey() */ __pyx_t_1 = __pyx_v_self->__pyx_base.matches; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = ((__pyx_v_self->__pyx_base.i == PyList_GET_SIZE(__pyx_t_1)) != 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":1382 * cdef PyObject *obj * if self.i == PyList_GET_SIZE(self.matches): * self.right = next(self.rightseq) # <<<<<<<<<<<<<< * key = self.rightkey() * obj = PyDict_GetItem(self.d, key) */ __pyx_t_1 = __pyx_v_self->__pyx_base.rightseq; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->__pyx_base.right); __Pyx_DECREF(__pyx_v_self->__pyx_base.right); __pyx_v_self->__pyx_base.right = __pyx_t_3; __pyx_t_3 = 0; /* "cytoolz/itertoolz.pyx":1383 * if self.i == PyList_GET_SIZE(self.matches): * self.right = next(self.rightseq) * key = self.rightkey() # <<<<<<<<<<<<<< * obj = PyDict_GetItem(self.d, key) * if obj is NULL: */ __pyx_t_3 = ((struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.rightkey(((struct __pyx_obj_7cytoolz_9itertoolz__join *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_key = __pyx_t_3; __pyx_t_3 = 0; /* "cytoolz/itertoolz.pyx":1384 * self.right = next(self.rightseq) * key = self.rightkey() * obj = PyDict_GetItem(self.d, key) # <<<<<<<<<<<<<< * if obj is NULL: * return (self.left_default, self.right) */ __pyx_t_3 = __pyx_v_self->__pyx_base.d; __Pyx_INCREF(__pyx_t_3); __pyx_v_obj = PyDict_GetItem(__pyx_t_3, __pyx_v_key); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/itertoolz.pyx":1385 * key = self.rightkey() * obj = PyDict_GetItem(self.d, key) * if obj is NULL: # <<<<<<<<<<<<<< * return (self.left_default, self.right) * self.matches = obj */ __pyx_t_2 = ((__pyx_v_obj == NULL) != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":1386 * obj = PyDict_GetItem(self.d, key) * if obj is NULL: * return (self.left_default, self.right) # <<<<<<<<<<<<<< * self.matches = obj * self.i = 0 */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_self->__pyx_base.left_default); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.left_default); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->__pyx_base.left_default); __Pyx_INCREF(__pyx_v_self->__pyx_base.right); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.right); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->__pyx_base.right); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1385 * key = self.rightkey() * obj = PyDict_GetItem(self.d, key) * if obj is NULL: # <<<<<<<<<<<<<< * return (self.left_default, self.right) * self.matches = obj */ } /* "cytoolz/itertoolz.pyx":1387 * if obj is NULL: * return (self.left_default, self.right) * self.matches = obj # <<<<<<<<<<<<<< * self.i = 0 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking */ if (!(likely(PyList_CheckExact(((PyObject *)__pyx_v_obj)))||((((PyObject *)__pyx_v_obj)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(((PyObject *)__pyx_v_obj))->tp_name), 0))) __PYX_ERR(0, 1387, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_obj); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->__pyx_base.matches); __Pyx_DECREF(__pyx_v_self->__pyx_base.matches); __pyx_v_self->__pyx_base.matches = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/itertoolz.pyx":1388 * return (self.left_default, self.right) * self.matches = obj * self.i = 0 # <<<<<<<<<<<<<< * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking * self.i += 1 */ __pyx_v_self->__pyx_base.i = 0; /* "cytoolz/itertoolz.pyx":1381 * def __next__(self): * cdef PyObject *obj * if self.i == PyList_GET_SIZE(self.matches): # <<<<<<<<<<<<<< * self.right = next(self.rightseq) * key = self.rightkey() */ } /* "cytoolz/itertoolz.pyx":1389 * self.matches = obj * self.i = 0 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking # <<<<<<<<<<<<<< * self.i += 1 * return (match, self.right) */ __pyx_t_3 = __pyx_v_self->__pyx_base.matches; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_v_self->__pyx_base.i); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = ((PyObject *)__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_v_match = __pyx_t_3; __pyx_t_3 = 0; /* "cytoolz/itertoolz.pyx":1390 * self.i = 0 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking * self.i += 1 # <<<<<<<<<<<<<< * return (match, self.right) * */ __pyx_v_self->__pyx_base.i = (__pyx_v_self->__pyx_base.i + 1); /* "cytoolz/itertoolz.pyx":1391 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking * self.i += 1 * return (match, self.right) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1391, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_match); __Pyx_GIVEREF(__pyx_v_match); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_match); __Pyx_INCREF(__pyx_v_self->__pyx_base.right); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.right); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->__pyx_base.right); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1379 * * cdef class _right_outer_join(_join): * def __next__(self): # <<<<<<<<<<<<<< * cdef PyObject *obj * if self.i == PyList_GET_SIZE(self.matches): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.itertoolz._right_outer_join.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_match); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_17_right_outer_join_2__reduce_cython__[] = "_right_outer_join.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_17_right_outer_join_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_3__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_17_right_outer_join_2__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_17_right_outer_join_2__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_right_outer_join_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._right_outer_join.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_17_right_outer_join_4__setstate_cython__[] = "_right_outer_join.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_17_right_outer_join_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_5__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_17_right_outer_join_4__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_17_right_outer_join_4__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_right_outer_join_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._right_outer_join.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1395 * * cdef class _right_outer_join_key(_right_outer_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * return self._rightkey(self.right) * */ static PyObject *__pyx_f_7cytoolz_9itertoolz_21_right_outer_join_key_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("rightkey", 0); /* "cytoolz/itertoolz.pyx":1396 * cdef class _right_outer_join_key(_right_outer_join): * cdef object rightkey(self): * return self._rightkey(self.right) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base._rightkey); __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base._rightkey; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->__pyx_base.__pyx_base.right) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->__pyx_base.__pyx_base.right); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1396, __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; /* "cytoolz/itertoolz.pyx":1395 * * cdef class _right_outer_join_key(_right_outer_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * return self._rightkey(self.right) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.itertoolz._right_outer_join_key.rightkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_21_right_outer_join_key_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_21_right_outer_join_key___reduce_cython__[] = "_right_outer_join_key.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_21_right_outer_join_key_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_21_right_outer_join_key_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_21_right_outer_join_key___reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_21_right_outer_join_key_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_21_right_outer_join_key___reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_21_right_outer_join_key___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._right_outer_join_key.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_21_right_outer_join_key_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_21_right_outer_join_key_2__setstate_cython__[] = "_right_outer_join_key.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_21_right_outer_join_key_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_21_right_outer_join_key_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_21_right_outer_join_key_2__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_21_right_outer_join_key_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_21_right_outer_join_key_2__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_21_right_outer_join_key_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._right_outer_join_key.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1400 * * cdef class _right_outer_join_index(_right_outer_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * return self.right[self._rightkey] * */ static PyObject *__pyx_f_7cytoolz_9itertoolz_23_right_outer_join_index_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("rightkey", 0); /* "cytoolz/itertoolz.pyx":1401 * cdef class _right_outer_join_index(_right_outer_join): * cdef object rightkey(self): * return self.right[self._rightkey] # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->__pyx_base.__pyx_base.right, __pyx_v_self->__pyx_base.__pyx_base._rightkey); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1400 * * cdef class _right_outer_join_index(_right_outer_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * return self.right[self._rightkey] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._right_outer_join_index.rightkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_23_right_outer_join_index_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_23_right_outer_join_index___reduce_cython__[] = "_right_outer_join_index.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_23_right_outer_join_index_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_23_right_outer_join_index_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_23_right_outer_join_index___reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_23_right_outer_join_index_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_23_right_outer_join_index___reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_23_right_outer_join_index___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._right_outer_join_index.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_23_right_outer_join_index_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_23_right_outer_join_index_2__setstate_cython__[] = "_right_outer_join_index.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_23_right_outer_join_index_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_23_right_outer_join_index_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_23_right_outer_join_index_2__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_23_right_outer_join_index_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_23_right_outer_join_index_2__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_23_right_outer_join_index_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._right_outer_join_index.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1405 * * cdef class _right_outer_join_indices(_right_outer_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * keyval = PyTuple_New(self.N) * for i in range(self.N): */ static PyObject *__pyx_f_7cytoolz_9itertoolz_25_right_outer_join_indices_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices *__pyx_v_self) { PyObject *__pyx_v_keyval = NULL; Py_ssize_t __pyx_v_i; PyObject *__pyx_v_val = NULL; 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; __Pyx_RefNannySetupContext("rightkey", 0); /* "cytoolz/itertoolz.pyx":1406 * cdef class _right_outer_join_indices(_right_outer_join): * cdef object rightkey(self): * keyval = PyTuple_New(self.N) # <<<<<<<<<<<<<< * for i in range(self.N): * val = PyList_GET_ITEM(self._rightkey, i) */ __pyx_t_1 = PyTuple_New(__pyx_v_self->__pyx_base.__pyx_base.N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_keyval = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1407 * cdef object rightkey(self): * keyval = PyTuple_New(self.N) * for i in range(self.N): # <<<<<<<<<<<<<< * val = PyList_GET_ITEM(self._rightkey, i) * val = self.right[val] */ __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.N; __pyx_t_3 = __pyx_t_2; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; /* "cytoolz/itertoolz.pyx":1408 * keyval = PyTuple_New(self.N) * for i in range(self.N): * val = PyList_GET_ITEM(self._rightkey, i) # <<<<<<<<<<<<<< * val = self.right[val] * Py_INCREF(val) */ __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base._rightkey; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_v_i); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = ((PyObject *)__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1409 * for i in range(self.N): * val = PyList_GET_ITEM(self._rightkey, i) * val = self.right[val] # <<<<<<<<<<<<<< * Py_INCREF(val) * PyTuple_SET_ITEM(keyval, i, val) */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->__pyx_base.__pyx_base.right, __pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1410 * val = PyList_GET_ITEM(self._rightkey, i) * val = self.right[val] * Py_INCREF(val) # <<<<<<<<<<<<<< * PyTuple_SET_ITEM(keyval, i, val) * return keyval */ Py_INCREF(__pyx_v_val); /* "cytoolz/itertoolz.pyx":1411 * val = self.right[val] * Py_INCREF(val) * PyTuple_SET_ITEM(keyval, i, val) # <<<<<<<<<<<<<< * return keyval * */ PyTuple_SET_ITEM(__pyx_v_keyval, __pyx_v_i, __pyx_v_val); } /* "cytoolz/itertoolz.pyx":1412 * Py_INCREF(val) * PyTuple_SET_ITEM(keyval, i, val) * return keyval # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_keyval); __pyx_r = __pyx_v_keyval; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1405 * * cdef class _right_outer_join_indices(_right_outer_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * keyval = PyTuple_New(self.N) * for i in range(self.N): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._right_outer_join_indices.rightkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_keyval); __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_25_right_outer_join_indices_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_25_right_outer_join_indices___reduce_cython__[] = "_right_outer_join_indices.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_25_right_outer_join_indices_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_25_right_outer_join_indices_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_25_right_outer_join_indices___reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_25_right_outer_join_indices_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_25_right_outer_join_indices___reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_25_right_outer_join_indices___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._right_outer_join_indices.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_25_right_outer_join_indices_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_25_right_outer_join_indices_2__setstate_cython__[] = "_right_outer_join_indices.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_25_right_outer_join_indices_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_25_right_outer_join_indices_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_25_right_outer_join_indices_2__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_25_right_outer_join_indices_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_25_right_outer_join_indices_2__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_25_right_outer_join_indices_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._right_outer_join_indices.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1416 * * cdef class _outer_join(_join): * def __next__(self): # <<<<<<<<<<<<<< * cdef PyObject *obj * if not self.is_rightseq_exhausted: */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_outer_join_1__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_outer_join_1__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_outer_join___next__(((struct __pyx_obj_7cytoolz_9itertoolz__outer_join *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_outer_join___next__(struct __pyx_obj_7cytoolz_9itertoolz__outer_join *__pyx_v_self) { PyObject *__pyx_v_obj; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_match = 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_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11; int __pyx_t_12; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":1418 * def __next__(self): * cdef PyObject *obj * if not self.is_rightseq_exhausted: # <<<<<<<<<<<<<< * if self.i == PyList_GET_SIZE(self.matches): * try: */ __pyx_t_1 = ((!(__pyx_v_self->__pyx_base.is_rightseq_exhausted != 0)) != 0); if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":1419 * cdef PyObject *obj * if not self.is_rightseq_exhausted: * if self.i == PyList_GET_SIZE(self.matches): # <<<<<<<<<<<<<< * try: * self.right = next(self.rightseq) */ __pyx_t_2 = __pyx_v_self->__pyx_base.matches; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = ((__pyx_v_self->__pyx_base.i == PyList_GET_SIZE(__pyx_t_2)) != 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":1420 * if not self.is_rightseq_exhausted: * if self.i == PyList_GET_SIZE(self.matches): * try: # <<<<<<<<<<<<<< * self.right = next(self.rightseq) * except StopIteration: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __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:*/ { /* "cytoolz/itertoolz.pyx":1421 * if self.i == PyList_GET_SIZE(self.matches): * try: * self.right = next(self.rightseq) # <<<<<<<<<<<<<< * except StopIteration: * self.is_rightseq_exhausted = True */ __pyx_t_2 = __pyx_v_self->__pyx_base.rightseq; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1421, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_v_self->__pyx_base.right); __Pyx_DECREF(__pyx_v_self->__pyx_base.right); __pyx_v_self->__pyx_base.right = __pyx_t_6; __pyx_t_6 = 0; /* "cytoolz/itertoolz.pyx":1420 * if not self.is_rightseq_exhausted: * if self.i == PyList_GET_SIZE(self.matches): * try: # <<<<<<<<<<<<<< * self.right = next(self.rightseq) * except StopIteration: */ } __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_L5_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "cytoolz/itertoolz.pyx":1422 * try: * self.right = next(self.rightseq) * except StopIteration: # <<<<<<<<<<<<<< * self.is_rightseq_exhausted = True * self.keys = iter(self.d) */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_7) { __Pyx_AddTraceback("cytoolz.itertoolz._outer_join.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_2, &__pyx_t_8) < 0) __PYX_ERR(0, 1422, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_8); /* "cytoolz/itertoolz.pyx":1423 * self.right = next(self.rightseq) * except StopIteration: * self.is_rightseq_exhausted = True # <<<<<<<<<<<<<< * self.keys = iter(self.d) * return next(self) */ __pyx_v_self->__pyx_base.is_rightseq_exhausted = 1; /* "cytoolz/itertoolz.pyx":1424 * except StopIteration: * self.is_rightseq_exhausted = True * self.keys = iter(self.d) # <<<<<<<<<<<<<< * return next(self) * key = self.rightkey() */ __pyx_t_9 = __pyx_v_self->__pyx_base.d; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1424, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GIVEREF(__pyx_t_10); __Pyx_GOTREF(__pyx_v_self->__pyx_base.keys); __Pyx_DECREF(__pyx_v_self->__pyx_base.keys); __pyx_v_self->__pyx_base.keys = __pyx_t_10; __pyx_t_10 = 0; /* "cytoolz/itertoolz.pyx":1425 * self.is_rightseq_exhausted = True * self.keys = iter(self.d) * return next(self) # <<<<<<<<<<<<<< * key = self.rightkey() * PySet_Add(self.seen_keys, key) */ __Pyx_XDECREF(__pyx_r); __pyx_t_10 = __Pyx_PyIter_Next(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1425, __pyx_L7_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_r = __pyx_t_10; __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L8_except_return; } goto __pyx_L7_except_error; __pyx_L7_except_error:; /* "cytoolz/itertoolz.pyx":1420 * if not self.is_rightseq_exhausted: * if self.i == PyList_GET_SIZE(self.matches): * try: # <<<<<<<<<<<<<< * self.right = next(self.rightseq) * except StopIteration: */ __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_L8_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_L10_try_end:; } /* "cytoolz/itertoolz.pyx":1426 * self.keys = iter(self.d) * return next(self) * key = self.rightkey() # <<<<<<<<<<<<<< * PySet_Add(self.seen_keys, key) * obj = PyDict_GetItem(self.d, key) */ __pyx_t_8 = ((struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.rightkey(((struct __pyx_obj_7cytoolz_9itertoolz__join *)__pyx_v_self)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_key = __pyx_t_8; __pyx_t_8 = 0; /* "cytoolz/itertoolz.pyx":1427 * return next(self) * key = self.rightkey() * PySet_Add(self.seen_keys, key) # <<<<<<<<<<<<<< * obj = PyDict_GetItem(self.d, key) * if obj is NULL: */ __pyx_t_8 = __pyx_v_self->__pyx_base.seen_keys; __Pyx_INCREF(__pyx_t_8); __pyx_t_7 = PySet_Add(__pyx_t_8, __pyx_v_key); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1427, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "cytoolz/itertoolz.pyx":1428 * key = self.rightkey() * PySet_Add(self.seen_keys, key) * obj = PyDict_GetItem(self.d, key) # <<<<<<<<<<<<<< * if obj is NULL: * return (self.left_default, self.right) */ __pyx_t_8 = __pyx_v_self->__pyx_base.d; __Pyx_INCREF(__pyx_t_8); __pyx_v_obj = PyDict_GetItem(__pyx_t_8, __pyx_v_key); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "cytoolz/itertoolz.pyx":1429 * PySet_Add(self.seen_keys, key) * obj = PyDict_GetItem(self.d, key) * if obj is NULL: # <<<<<<<<<<<<<< * return (self.left_default, self.right) * self.matches = obj */ __pyx_t_1 = ((__pyx_v_obj == NULL) != 0); if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":1430 * obj = PyDict_GetItem(self.d, key) * if obj is NULL: * return (self.left_default, self.right) # <<<<<<<<<<<<<< * self.matches = obj * self.i = 0 */ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_self->__pyx_base.left_default); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.left_default); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_self->__pyx_base.left_default); __Pyx_INCREF(__pyx_v_self->__pyx_base.right); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.right); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_self->__pyx_base.right); __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1429 * PySet_Add(self.seen_keys, key) * obj = PyDict_GetItem(self.d, key) * if obj is NULL: # <<<<<<<<<<<<<< * return (self.left_default, self.right) * self.matches = obj */ } /* "cytoolz/itertoolz.pyx":1431 * if obj is NULL: * return (self.left_default, self.right) * self.matches = obj # <<<<<<<<<<<<<< * self.i = 0 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking */ if (!(likely(PyList_CheckExact(((PyObject *)__pyx_v_obj)))||((((PyObject *)__pyx_v_obj)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(((PyObject *)__pyx_v_obj))->tp_name), 0))) __PYX_ERR(0, 1431, __pyx_L1_error) __pyx_t_8 = ((PyObject *)__pyx_v_obj); __Pyx_INCREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __Pyx_GOTREF(__pyx_v_self->__pyx_base.matches); __Pyx_DECREF(__pyx_v_self->__pyx_base.matches); __pyx_v_self->__pyx_base.matches = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; /* "cytoolz/itertoolz.pyx":1432 * return (self.left_default, self.right) * self.matches = obj * self.i = 0 # <<<<<<<<<<<<<< * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking * self.i += 1 */ __pyx_v_self->__pyx_base.i = 0; /* "cytoolz/itertoolz.pyx":1419 * cdef PyObject *obj * if not self.is_rightseq_exhausted: * if self.i == PyList_GET_SIZE(self.matches): # <<<<<<<<<<<<<< * try: * self.right = next(self.rightseq) */ } /* "cytoolz/itertoolz.pyx":1433 * self.matches = obj * self.i = 0 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking # <<<<<<<<<<<<<< * self.i += 1 * return (match, self.right) */ __pyx_t_8 = __pyx_v_self->__pyx_base.matches; __Pyx_INCREF(__pyx_t_8); __pyx_t_11 = PyList_GET_ITEM(__pyx_t_8, __pyx_v_self->__pyx_base.i); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = ((PyObject *)__pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_v_match = __pyx_t_8; __pyx_t_8 = 0; /* "cytoolz/itertoolz.pyx":1434 * self.i = 0 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking * self.i += 1 # <<<<<<<<<<<<<< * return (match, self.right) * */ __pyx_v_self->__pyx_base.i = (__pyx_v_self->__pyx_base.i + 1); /* "cytoolz/itertoolz.pyx":1435 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking * self.i += 1 * return (match, self.right) # <<<<<<<<<<<<<< * * else: */ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_match); __Pyx_GIVEREF(__pyx_v_match); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_match); __Pyx_INCREF(__pyx_v_self->__pyx_base.right); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.right); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_self->__pyx_base.right); __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1418 * def __next__(self): * cdef PyObject *obj * if not self.is_rightseq_exhausted: # <<<<<<<<<<<<<< * if self.i == PyList_GET_SIZE(self.matches): * try: */ } /* "cytoolz/itertoolz.pyx":1438 * * else: * if self.i == PyList_GET_SIZE(self.matches): # <<<<<<<<<<<<<< * key = next(self.keys) * while key in self.seen_keys: */ /*else*/ { __pyx_t_8 = __pyx_v_self->__pyx_base.matches; __Pyx_INCREF(__pyx_t_8); __pyx_t_1 = ((__pyx_v_self->__pyx_base.i == PyList_GET_SIZE(__pyx_t_8)) != 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":1439 * else: * if self.i == PyList_GET_SIZE(self.matches): * key = next(self.keys) # <<<<<<<<<<<<<< * while key in self.seen_keys: * key = next(self.keys) */ __pyx_t_8 = __pyx_v_self->__pyx_base.keys; __Pyx_INCREF(__pyx_t_8); __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_key = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1440 * if self.i == PyList_GET_SIZE(self.matches): * key = next(self.keys) * while key in self.seen_keys: # <<<<<<<<<<<<<< * key = next(self.keys) * obj = PyDict_GetItem(self.d, key) */ while (1) { if (unlikely(__pyx_v_self->__pyx_base.seen_keys == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 1440, __pyx_L1_error) } __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_key, __pyx_v_self->__pyx_base.seen_keys, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1440, __pyx_L1_error) __pyx_t_12 = (__pyx_t_1 != 0); if (!__pyx_t_12) break; /* "cytoolz/itertoolz.pyx":1441 * key = next(self.keys) * while key in self.seen_keys: * key = next(self.keys) # <<<<<<<<<<<<<< * obj = PyDict_GetItem(self.d, key) * self.matches = obj */ __pyx_t_2 = __pyx_v_self->__pyx_base.keys; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_8); __pyx_t_8 = 0; } /* "cytoolz/itertoolz.pyx":1442 * while key in self.seen_keys: * key = next(self.keys) * obj = PyDict_GetItem(self.d, key) # <<<<<<<<<<<<<< * self.matches = obj * self.i = 0 */ __pyx_t_8 = __pyx_v_self->__pyx_base.d; __Pyx_INCREF(__pyx_t_8); __pyx_v_obj = PyDict_GetItem(__pyx_t_8, __pyx_v_key); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "cytoolz/itertoolz.pyx":1443 * key = next(self.keys) * obj = PyDict_GetItem(self.d, key) * self.matches = obj # <<<<<<<<<<<<<< * self.i = 0 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking */ if (!(likely(PyList_CheckExact(((PyObject *)__pyx_v_obj)))||((((PyObject *)__pyx_v_obj)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(((PyObject *)__pyx_v_obj))->tp_name), 0))) __PYX_ERR(0, 1443, __pyx_L1_error) __pyx_t_8 = ((PyObject *)__pyx_v_obj); __Pyx_INCREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __Pyx_GOTREF(__pyx_v_self->__pyx_base.matches); __Pyx_DECREF(__pyx_v_self->__pyx_base.matches); __pyx_v_self->__pyx_base.matches = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; /* "cytoolz/itertoolz.pyx":1444 * obj = PyDict_GetItem(self.d, key) * self.matches = obj * self.i = 0 # <<<<<<<<<<<<<< * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking * self.i += 1 */ __pyx_v_self->__pyx_base.i = 0; /* "cytoolz/itertoolz.pyx":1438 * * else: * if self.i == PyList_GET_SIZE(self.matches): # <<<<<<<<<<<<<< * key = next(self.keys) * while key in self.seen_keys: */ } /* "cytoolz/itertoolz.pyx":1445 * self.matches = obj * self.i = 0 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking # <<<<<<<<<<<<<< * self.i += 1 * return (match, self.right_default) */ __pyx_t_8 = __pyx_v_self->__pyx_base.matches; __Pyx_INCREF(__pyx_t_8); __pyx_t_11 = PyList_GET_ITEM(__pyx_t_8, __pyx_v_self->__pyx_base.i); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = ((PyObject *)__pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_v_match = __pyx_t_8; __pyx_t_8 = 0; /* "cytoolz/itertoolz.pyx":1446 * self.i = 0 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking * self.i += 1 # <<<<<<<<<<<<<< * return (match, self.right_default) * */ __pyx_v_self->__pyx_base.i = (__pyx_v_self->__pyx_base.i + 1); /* "cytoolz/itertoolz.pyx":1447 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking * self.i += 1 * return (match, self.right_default) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_match); __Pyx_GIVEREF(__pyx_v_match); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_match); __Pyx_INCREF(__pyx_v_self->__pyx_base.right_default); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.right_default); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_self->__pyx_base.right_default); __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; } /* "cytoolz/itertoolz.pyx":1416 * * cdef class _outer_join(_join): * def __next__(self): # <<<<<<<<<<<<<< * cdef PyObject *obj * if not self.is_rightseq_exhausted: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("cytoolz.itertoolz._outer_join.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_match); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_outer_join_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_11_outer_join_2__reduce_cython__[] = "_outer_join.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_11_outer_join_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11_outer_join_3__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_11_outer_join_2__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_outer_join_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_outer_join_2__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__outer_join *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_outer_join_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__outer_join *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._outer_join.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_outer_join_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_11_outer_join_4__setstate_cython__[] = "_outer_join.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_11_outer_join_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11_outer_join_5__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_11_outer_join_4__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_outer_join_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_outer_join_4__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__outer_join *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_outer_join_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__outer_join *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._outer_join.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1451 * * cdef class _outer_join_key(_outer_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * return self._rightkey(self.right) * */ static PyObject *__pyx_f_7cytoolz_9itertoolz_15_outer_join_key_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("rightkey", 0); /* "cytoolz/itertoolz.pyx":1452 * cdef class _outer_join_key(_outer_join): * cdef object rightkey(self): * return self._rightkey(self.right) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base._rightkey); __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base._rightkey; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->__pyx_base.__pyx_base.right) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->__pyx_base.__pyx_base.right); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1452, __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; /* "cytoolz/itertoolz.pyx":1451 * * cdef class _outer_join_key(_outer_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * return self._rightkey(self.right) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.itertoolz._outer_join_key.rightkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_15_outer_join_key_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_15_outer_join_key___reduce_cython__[] = "_outer_join_key.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_15_outer_join_key_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_15_outer_join_key_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_15_outer_join_key___reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_15_outer_join_key_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_15_outer_join_key___reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_15_outer_join_key___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._outer_join_key.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_15_outer_join_key_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_15_outer_join_key_2__setstate_cython__[] = "_outer_join_key.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_15_outer_join_key_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_15_outer_join_key_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_15_outer_join_key_2__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_15_outer_join_key_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_15_outer_join_key_2__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_15_outer_join_key_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._outer_join_key.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1456 * * cdef class _outer_join_index(_outer_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * return self.right[self._rightkey] * */ static PyObject *__pyx_f_7cytoolz_9itertoolz_17_outer_join_index_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("rightkey", 0); /* "cytoolz/itertoolz.pyx":1457 * cdef class _outer_join_index(_outer_join): * cdef object rightkey(self): * return self.right[self._rightkey] # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->__pyx_base.__pyx_base.right, __pyx_v_self->__pyx_base.__pyx_base._rightkey); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1456 * * cdef class _outer_join_index(_outer_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * return self.right[self._rightkey] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._outer_join_index.rightkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_outer_join_index_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_17_outer_join_index___reduce_cython__[] = "_outer_join_index.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_17_outer_join_index_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_17_outer_join_index_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_17_outer_join_index___reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_outer_join_index_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_17_outer_join_index___reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_outer_join_index___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._outer_join_index.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_outer_join_index_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_17_outer_join_index_2__setstate_cython__[] = "_outer_join_index.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_17_outer_join_index_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_17_outer_join_index_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_17_outer_join_index_2__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_outer_join_index_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_17_outer_join_index_2__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_outer_join_index_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._outer_join_index.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1461 * * cdef class _outer_join_indices(_outer_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * keyval = PyTuple_New(self.N) * for i in range(self.N): */ static PyObject *__pyx_f_7cytoolz_9itertoolz_19_outer_join_indices_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices *__pyx_v_self) { PyObject *__pyx_v_keyval = NULL; Py_ssize_t __pyx_v_i; PyObject *__pyx_v_val = NULL; 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; __Pyx_RefNannySetupContext("rightkey", 0); /* "cytoolz/itertoolz.pyx":1462 * cdef class _outer_join_indices(_outer_join): * cdef object rightkey(self): * keyval = PyTuple_New(self.N) # <<<<<<<<<<<<<< * for i in range(self.N): * val = PyList_GET_ITEM(self._rightkey, i) */ __pyx_t_1 = PyTuple_New(__pyx_v_self->__pyx_base.__pyx_base.N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_keyval = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1463 * cdef object rightkey(self): * keyval = PyTuple_New(self.N) * for i in range(self.N): # <<<<<<<<<<<<<< * val = PyList_GET_ITEM(self._rightkey, i) * val = self.right[val] */ __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.N; __pyx_t_3 = __pyx_t_2; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; /* "cytoolz/itertoolz.pyx":1464 * keyval = PyTuple_New(self.N) * for i in range(self.N): * val = PyList_GET_ITEM(self._rightkey, i) # <<<<<<<<<<<<<< * val = self.right[val] * Py_INCREF(val) */ __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base._rightkey; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_v_i); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = ((PyObject *)__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1465 * for i in range(self.N): * val = PyList_GET_ITEM(self._rightkey, i) * val = self.right[val] # <<<<<<<<<<<<<< * Py_INCREF(val) * PyTuple_SET_ITEM(keyval, i, val) */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->__pyx_base.__pyx_base.right, __pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1466 * val = PyList_GET_ITEM(self._rightkey, i) * val = self.right[val] * Py_INCREF(val) # <<<<<<<<<<<<<< * PyTuple_SET_ITEM(keyval, i, val) * return keyval */ Py_INCREF(__pyx_v_val); /* "cytoolz/itertoolz.pyx":1467 * val = self.right[val] * Py_INCREF(val) * PyTuple_SET_ITEM(keyval, i, val) # <<<<<<<<<<<<<< * return keyval * */ PyTuple_SET_ITEM(__pyx_v_keyval, __pyx_v_i, __pyx_v_val); } /* "cytoolz/itertoolz.pyx":1468 * Py_INCREF(val) * PyTuple_SET_ITEM(keyval, i, val) * return keyval # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_keyval); __pyx_r = __pyx_v_keyval; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1461 * * cdef class _outer_join_indices(_outer_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * keyval = PyTuple_New(self.N) * for i in range(self.N): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._outer_join_indices.rightkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_keyval); __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_19_outer_join_indices_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_19_outer_join_indices___reduce_cython__[] = "_outer_join_indices.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_19_outer_join_indices_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_19_outer_join_indices_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_19_outer_join_indices___reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_19_outer_join_indices_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_19_outer_join_indices___reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_19_outer_join_indices___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._outer_join_indices.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_19_outer_join_indices_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_19_outer_join_indices_2__setstate_cython__[] = "_outer_join_indices.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_19_outer_join_indices_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_19_outer_join_indices_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_19_outer_join_indices_2__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_19_outer_join_indices_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_19_outer_join_indices_2__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_19_outer_join_indices_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._outer_join_indices.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1472 * * cdef class _left_outer_join(_join): * def __next__(self): # <<<<<<<<<<<<<< * cdef PyObject *obj * if not self.is_rightseq_exhausted: */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_1__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_1__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_16_left_outer_join___next__(((struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_16_left_outer_join___next__(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join *__pyx_v_self) { PyObject *__pyx_v_obj; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_match = 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_t_7; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11; int __pyx_t_12; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":1474 * def __next__(self): * cdef PyObject *obj * if not self.is_rightseq_exhausted: # <<<<<<<<<<<<<< * if self.i == PyList_GET_SIZE(self.matches): * obj = NULL */ __pyx_t_1 = ((!(__pyx_v_self->__pyx_base.is_rightseq_exhausted != 0)) != 0); if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":1475 * cdef PyObject *obj * if not self.is_rightseq_exhausted: * if self.i == PyList_GET_SIZE(self.matches): # <<<<<<<<<<<<<< * obj = NULL * while obj is NULL: */ __pyx_t_2 = __pyx_v_self->__pyx_base.matches; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = ((__pyx_v_self->__pyx_base.i == PyList_GET_SIZE(__pyx_t_2)) != 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":1476 * if not self.is_rightseq_exhausted: * if self.i == PyList_GET_SIZE(self.matches): * obj = NULL # <<<<<<<<<<<<<< * while obj is NULL: * try: */ __pyx_v_obj = NULL; /* "cytoolz/itertoolz.pyx":1477 * if self.i == PyList_GET_SIZE(self.matches): * obj = NULL * while obj is NULL: # <<<<<<<<<<<<<< * try: * self.right = next(self.rightseq) */ while (1) { __pyx_t_1 = ((__pyx_v_obj == NULL) != 0); if (!__pyx_t_1) break; /* "cytoolz/itertoolz.pyx":1478 * obj = NULL * while obj is NULL: * try: # <<<<<<<<<<<<<< * self.right = next(self.rightseq) * except StopIteration: */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __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:*/ { /* "cytoolz/itertoolz.pyx":1479 * while obj is NULL: * try: * self.right = next(self.rightseq) # <<<<<<<<<<<<<< * except StopIteration: * self.is_rightseq_exhausted = True */ __pyx_t_2 = __pyx_v_self->__pyx_base.rightseq; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1479, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_v_self->__pyx_base.right); __Pyx_DECREF(__pyx_v_self->__pyx_base.right); __pyx_v_self->__pyx_base.right = __pyx_t_6; __pyx_t_6 = 0; /* "cytoolz/itertoolz.pyx":1478 * obj = NULL * while obj is NULL: * try: # <<<<<<<<<<<<<< * self.right = next(self.rightseq) * except StopIteration: */ } __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_L14_try_end; __pyx_L7_error:; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /* "cytoolz/itertoolz.pyx":1480 * try: * self.right = next(self.rightseq) * except StopIteration: # <<<<<<<<<<<<<< * self.is_rightseq_exhausted = True * self.keys = iter(self.d) */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration); if (__pyx_t_7) { __Pyx_AddTraceback("cytoolz.itertoolz._left_outer_join.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_2, &__pyx_t_8) < 0) __PYX_ERR(0, 1480, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GOTREF(__pyx_t_2); __Pyx_GOTREF(__pyx_t_8); /* "cytoolz/itertoolz.pyx":1481 * self.right = next(self.rightseq) * except StopIteration: * self.is_rightseq_exhausted = True # <<<<<<<<<<<<<< * self.keys = iter(self.d) * return next(self) */ __pyx_v_self->__pyx_base.is_rightseq_exhausted = 1; /* "cytoolz/itertoolz.pyx":1482 * except StopIteration: * self.is_rightseq_exhausted = True * self.keys = iter(self.d) # <<<<<<<<<<<<<< * return next(self) * key = self.rightkey() */ __pyx_t_9 = __pyx_v_self->__pyx_base.d; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1482, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GIVEREF(__pyx_t_10); __Pyx_GOTREF(__pyx_v_self->__pyx_base.keys); __Pyx_DECREF(__pyx_v_self->__pyx_base.keys); __pyx_v_self->__pyx_base.keys = __pyx_t_10; __pyx_t_10 = 0; /* "cytoolz/itertoolz.pyx":1483 * self.is_rightseq_exhausted = True * self.keys = iter(self.d) * return next(self) # <<<<<<<<<<<<<< * key = self.rightkey() * PySet_Add(self.seen_keys, key) */ __Pyx_XDECREF(__pyx_r); __pyx_t_10 = __Pyx_PyIter_Next(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1483, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_r = __pyx_t_10; __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L10_except_return; } goto __pyx_L9_except_error; __pyx_L9_except_error:; /* "cytoolz/itertoolz.pyx":1478 * obj = NULL * while obj is NULL: * try: # <<<<<<<<<<<<<< * self.right = next(self.rightseq) * except StopIteration: */ __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_L10_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_L14_try_end:; } /* "cytoolz/itertoolz.pyx":1484 * self.keys = iter(self.d) * return next(self) * key = self.rightkey() # <<<<<<<<<<<<<< * PySet_Add(self.seen_keys, key) * obj = PyDict_GetItem(self.d, key) */ __pyx_t_8 = ((struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.rightkey(((struct __pyx_obj_7cytoolz_9itertoolz__join *)__pyx_v_self)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_8); __pyx_t_8 = 0; /* "cytoolz/itertoolz.pyx":1485 * return next(self) * key = self.rightkey() * PySet_Add(self.seen_keys, key) # <<<<<<<<<<<<<< * obj = PyDict_GetItem(self.d, key) * self.matches = obj */ __pyx_t_8 = __pyx_v_self->__pyx_base.seen_keys; __Pyx_INCREF(__pyx_t_8); __pyx_t_7 = PySet_Add(__pyx_t_8, __pyx_v_key); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1485, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "cytoolz/itertoolz.pyx":1486 * key = self.rightkey() * PySet_Add(self.seen_keys, key) * obj = PyDict_GetItem(self.d, key) # <<<<<<<<<<<<<< * self.matches = obj * self.i = 0 */ __pyx_t_8 = __pyx_v_self->__pyx_base.d; __Pyx_INCREF(__pyx_t_8); __pyx_v_obj = PyDict_GetItem(__pyx_t_8, __pyx_v_key); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } /* "cytoolz/itertoolz.pyx":1487 * PySet_Add(self.seen_keys, key) * obj = PyDict_GetItem(self.d, key) * self.matches = obj # <<<<<<<<<<<<<< * self.i = 0 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking */ if (!(likely(PyList_CheckExact(((PyObject *)__pyx_v_obj)))||((((PyObject *)__pyx_v_obj)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(((PyObject *)__pyx_v_obj))->tp_name), 0))) __PYX_ERR(0, 1487, __pyx_L1_error) __pyx_t_8 = ((PyObject *)__pyx_v_obj); __Pyx_INCREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __Pyx_GOTREF(__pyx_v_self->__pyx_base.matches); __Pyx_DECREF(__pyx_v_self->__pyx_base.matches); __pyx_v_self->__pyx_base.matches = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; /* "cytoolz/itertoolz.pyx":1488 * obj = PyDict_GetItem(self.d, key) * self.matches = obj * self.i = 0 # <<<<<<<<<<<<<< * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking * self.i += 1 */ __pyx_v_self->__pyx_base.i = 0; /* "cytoolz/itertoolz.pyx":1475 * cdef PyObject *obj * if not self.is_rightseq_exhausted: * if self.i == PyList_GET_SIZE(self.matches): # <<<<<<<<<<<<<< * obj = NULL * while obj is NULL: */ } /* "cytoolz/itertoolz.pyx":1489 * self.matches = obj * self.i = 0 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking # <<<<<<<<<<<<<< * self.i += 1 * return (match, self.right) */ __pyx_t_8 = __pyx_v_self->__pyx_base.matches; __Pyx_INCREF(__pyx_t_8); __pyx_t_11 = PyList_GET_ITEM(__pyx_t_8, __pyx_v_self->__pyx_base.i); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = ((PyObject *)__pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_v_match = __pyx_t_8; __pyx_t_8 = 0; /* "cytoolz/itertoolz.pyx":1490 * self.i = 0 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking * self.i += 1 # <<<<<<<<<<<<<< * return (match, self.right) * */ __pyx_v_self->__pyx_base.i = (__pyx_v_self->__pyx_base.i + 1); /* "cytoolz/itertoolz.pyx":1491 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking * self.i += 1 * return (match, self.right) # <<<<<<<<<<<<<< * * else: */ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_match); __Pyx_GIVEREF(__pyx_v_match); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_match); __Pyx_INCREF(__pyx_v_self->__pyx_base.right); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.right); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_self->__pyx_base.right); __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1474 * def __next__(self): * cdef PyObject *obj * if not self.is_rightseq_exhausted: # <<<<<<<<<<<<<< * if self.i == PyList_GET_SIZE(self.matches): * obj = NULL */ } /* "cytoolz/itertoolz.pyx":1494 * * else: * if self.i == PyList_GET_SIZE(self.matches): # <<<<<<<<<<<<<< * key = next(self.keys) * while key in self.seen_keys: */ /*else*/ { __pyx_t_8 = __pyx_v_self->__pyx_base.matches; __Pyx_INCREF(__pyx_t_8); __pyx_t_1 = ((__pyx_v_self->__pyx_base.i == PyList_GET_SIZE(__pyx_t_8)) != 0); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_1) { /* "cytoolz/itertoolz.pyx":1495 * else: * if self.i == PyList_GET_SIZE(self.matches): * key = next(self.keys) # <<<<<<<<<<<<<< * while key in self.seen_keys: * key = next(self.keys) */ __pyx_t_8 = __pyx_v_self->__pyx_base.keys; __Pyx_INCREF(__pyx_t_8); __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_v_key = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1496 * if self.i == PyList_GET_SIZE(self.matches): * key = next(self.keys) * while key in self.seen_keys: # <<<<<<<<<<<<<< * key = next(self.keys) * obj = PyDict_GetItem(self.d, key) */ while (1) { if (unlikely(__pyx_v_self->__pyx_base.seen_keys == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); __PYX_ERR(0, 1496, __pyx_L1_error) } __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_v_key, __pyx_v_self->__pyx_base.seen_keys, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1496, __pyx_L1_error) __pyx_t_12 = (__pyx_t_1 != 0); if (!__pyx_t_12) break; /* "cytoolz/itertoolz.pyx":1497 * key = next(self.keys) * while key in self.seen_keys: * key = next(self.keys) # <<<<<<<<<<<<<< * obj = PyDict_GetItem(self.d, key) * self.matches = obj */ __pyx_t_2 = __pyx_v_self->__pyx_base.keys; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_8); __pyx_t_8 = 0; } /* "cytoolz/itertoolz.pyx":1498 * while key in self.seen_keys: * key = next(self.keys) * obj = PyDict_GetItem(self.d, key) # <<<<<<<<<<<<<< * self.matches = obj * self.i = 0 */ __pyx_t_8 = __pyx_v_self->__pyx_base.d; __Pyx_INCREF(__pyx_t_8); __pyx_v_obj = PyDict_GetItem(__pyx_t_8, __pyx_v_key); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; /* "cytoolz/itertoolz.pyx":1499 * key = next(self.keys) * obj = PyDict_GetItem(self.d, key) * self.matches = obj # <<<<<<<<<<<<<< * self.i = 0 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking */ if (!(likely(PyList_CheckExact(((PyObject *)__pyx_v_obj)))||((((PyObject *)__pyx_v_obj)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(((PyObject *)__pyx_v_obj))->tp_name), 0))) __PYX_ERR(0, 1499, __pyx_L1_error) __pyx_t_8 = ((PyObject *)__pyx_v_obj); __Pyx_INCREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __Pyx_GOTREF(__pyx_v_self->__pyx_base.matches); __Pyx_DECREF(__pyx_v_self->__pyx_base.matches); __pyx_v_self->__pyx_base.matches = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; /* "cytoolz/itertoolz.pyx":1500 * obj = PyDict_GetItem(self.d, key) * self.matches = obj * self.i = 0 # <<<<<<<<<<<<<< * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking * self.i += 1 */ __pyx_v_self->__pyx_base.i = 0; /* "cytoolz/itertoolz.pyx":1494 * * else: * if self.i == PyList_GET_SIZE(self.matches): # <<<<<<<<<<<<<< * key = next(self.keys) * while key in self.seen_keys: */ } /* "cytoolz/itertoolz.pyx":1501 * self.matches = obj * self.i = 0 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking # <<<<<<<<<<<<<< * self.i += 1 * return (match, self.right_default) */ __pyx_t_8 = __pyx_v_self->__pyx_base.matches; __Pyx_INCREF(__pyx_t_8); __pyx_t_11 = PyList_GET_ITEM(__pyx_t_8, __pyx_v_self->__pyx_base.i); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = ((PyObject *)__pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_v_match = __pyx_t_8; __pyx_t_8 = 0; /* "cytoolz/itertoolz.pyx":1502 * self.i = 0 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking * self.i += 1 # <<<<<<<<<<<<<< * return (match, self.right_default) * */ __pyx_v_self->__pyx_base.i = (__pyx_v_self->__pyx_base.i + 1); /* "cytoolz/itertoolz.pyx":1503 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking * self.i += 1 * return (match, self.right_default) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_match); __Pyx_GIVEREF(__pyx_v_match); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_match); __Pyx_INCREF(__pyx_v_self->__pyx_base.right_default); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.right_default); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_self->__pyx_base.right_default); __pyx_r = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L0; } /* "cytoolz/itertoolz.pyx":1472 * * cdef class _left_outer_join(_join): * def __next__(self): # <<<<<<<<<<<<<< * cdef PyObject *obj * if not self.is_rightseq_exhausted: */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("cytoolz.itertoolz._left_outer_join.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_match); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_16_left_outer_join_2__reduce_cython__[] = "_left_outer_join.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_16_left_outer_join_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_3__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_16_left_outer_join_2__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_16_left_outer_join_2__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_16_left_outer_join_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._left_outer_join.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_16_left_outer_join_4__setstate_cython__[] = "_left_outer_join.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_16_left_outer_join_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_5__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_16_left_outer_join_4__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_16_left_outer_join_4__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_16_left_outer_join_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._left_outer_join.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1507 * * cdef class _left_outer_join_key(_left_outer_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * return self._rightkey(self.right) * */ static PyObject *__pyx_f_7cytoolz_9itertoolz_20_left_outer_join_key_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("rightkey", 0); /* "cytoolz/itertoolz.pyx":1508 * cdef class _left_outer_join_key(_left_outer_join): * cdef object rightkey(self): * return self._rightkey(self.right) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base._rightkey); __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base._rightkey; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->__pyx_base.__pyx_base.right) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->__pyx_base.__pyx_base.right); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1508, __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; /* "cytoolz/itertoolz.pyx":1507 * * cdef class _left_outer_join_key(_left_outer_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * return self._rightkey(self.right) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.itertoolz._left_outer_join_key.rightkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_20_left_outer_join_key_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_20_left_outer_join_key___reduce_cython__[] = "_left_outer_join_key.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_20_left_outer_join_key_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_20_left_outer_join_key_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_20_left_outer_join_key___reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_20_left_outer_join_key_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_20_left_outer_join_key___reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_20_left_outer_join_key___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._left_outer_join_key.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_20_left_outer_join_key_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_20_left_outer_join_key_2__setstate_cython__[] = "_left_outer_join_key.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_20_left_outer_join_key_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_20_left_outer_join_key_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_20_left_outer_join_key_2__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_20_left_outer_join_key_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_20_left_outer_join_key_2__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_20_left_outer_join_key_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._left_outer_join_key.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1512 * * cdef class _left_outer_join_index(_left_outer_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * return self.right[self._rightkey] * */ static PyObject *__pyx_f_7cytoolz_9itertoolz_22_left_outer_join_index_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("rightkey", 0); /* "cytoolz/itertoolz.pyx":1513 * cdef class _left_outer_join_index(_left_outer_join): * cdef object rightkey(self): * return self.right[self._rightkey] # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->__pyx_base.__pyx_base.right, __pyx_v_self->__pyx_base.__pyx_base._rightkey); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1512 * * cdef class _left_outer_join_index(_left_outer_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * return self.right[self._rightkey] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._left_outer_join_index.rightkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_22_left_outer_join_index_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_22_left_outer_join_index___reduce_cython__[] = "_left_outer_join_index.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_22_left_outer_join_index_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_22_left_outer_join_index_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_22_left_outer_join_index___reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_22_left_outer_join_index_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_22_left_outer_join_index___reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_22_left_outer_join_index___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._left_outer_join_index.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_22_left_outer_join_index_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_22_left_outer_join_index_2__setstate_cython__[] = "_left_outer_join_index.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_22_left_outer_join_index_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_22_left_outer_join_index_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_22_left_outer_join_index_2__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_22_left_outer_join_index_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_22_left_outer_join_index_2__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_22_left_outer_join_index_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._left_outer_join_index.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1517 * * cdef class _left_outer_join_indices(_left_outer_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * keyval = PyTuple_New(self.N) * for i in range(self.N): */ static PyObject *__pyx_f_7cytoolz_9itertoolz_24_left_outer_join_indices_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices *__pyx_v_self) { PyObject *__pyx_v_keyval = NULL; Py_ssize_t __pyx_v_i; PyObject *__pyx_v_val = NULL; 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; __Pyx_RefNannySetupContext("rightkey", 0); /* "cytoolz/itertoolz.pyx":1518 * cdef class _left_outer_join_indices(_left_outer_join): * cdef object rightkey(self): * keyval = PyTuple_New(self.N) # <<<<<<<<<<<<<< * for i in range(self.N): * val = PyList_GET_ITEM(self._rightkey, i) */ __pyx_t_1 = PyTuple_New(__pyx_v_self->__pyx_base.__pyx_base.N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_keyval = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1519 * cdef object rightkey(self): * keyval = PyTuple_New(self.N) * for i in range(self.N): # <<<<<<<<<<<<<< * val = PyList_GET_ITEM(self._rightkey, i) * val = self.right[val] */ __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.N; __pyx_t_3 = __pyx_t_2; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; /* "cytoolz/itertoolz.pyx":1520 * keyval = PyTuple_New(self.N) * for i in range(self.N): * val = PyList_GET_ITEM(self._rightkey, i) # <<<<<<<<<<<<<< * val = self.right[val] * Py_INCREF(val) */ __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base._rightkey; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_v_i); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = ((PyObject *)__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1521 * for i in range(self.N): * val = PyList_GET_ITEM(self._rightkey, i) * val = self.right[val] # <<<<<<<<<<<<<< * Py_INCREF(val) * PyTuple_SET_ITEM(keyval, i, val) */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->__pyx_base.__pyx_base.right, __pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1522 * val = PyList_GET_ITEM(self._rightkey, i) * val = self.right[val] * Py_INCREF(val) # <<<<<<<<<<<<<< * PyTuple_SET_ITEM(keyval, i, val) * return keyval */ Py_INCREF(__pyx_v_val); /* "cytoolz/itertoolz.pyx":1523 * val = self.right[val] * Py_INCREF(val) * PyTuple_SET_ITEM(keyval, i, val) # <<<<<<<<<<<<<< * return keyval * */ PyTuple_SET_ITEM(__pyx_v_keyval, __pyx_v_i, __pyx_v_val); } /* "cytoolz/itertoolz.pyx":1524 * Py_INCREF(val) * PyTuple_SET_ITEM(keyval, i, val) * return keyval # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_keyval); __pyx_r = __pyx_v_keyval; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1517 * * cdef class _left_outer_join_indices(_left_outer_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * keyval = PyTuple_New(self.N) * for i in range(self.N): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._left_outer_join_indices.rightkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_keyval); __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_24_left_outer_join_indices_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_24_left_outer_join_indices___reduce_cython__[] = "_left_outer_join_indices.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_24_left_outer_join_indices_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_24_left_outer_join_indices_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_24_left_outer_join_indices___reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_24_left_outer_join_indices_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_24_left_outer_join_indices___reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_24_left_outer_join_indices___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._left_outer_join_indices.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_24_left_outer_join_indices_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_24_left_outer_join_indices_2__setstate_cython__[] = "_left_outer_join_indices.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_24_left_outer_join_indices_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_24_left_outer_join_indices_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_24_left_outer_join_indices_2__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_24_left_outer_join_indices_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_24_left_outer_join_indices_2__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_24_left_outer_join_indices_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._left_outer_join_indices.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1528 * * cdef class _inner_join(_join): * def __next__(self): # <<<<<<<<<<<<<< * cdef PyObject *obj = NULL * if self.i == PyList_GET_SIZE(self.matches): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_inner_join_1__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_inner_join_1__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_inner_join___next__(((struct __pyx_obj_7cytoolz_9itertoolz__inner_join *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_inner_join___next__(struct __pyx_obj_7cytoolz_9itertoolz__inner_join *__pyx_v_self) { PyObject *__pyx_v_obj; PyObject *__pyx_v_key = NULL; PyObject *__pyx_v_match = 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; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":1529 * cdef class _inner_join(_join): * def __next__(self): * cdef PyObject *obj = NULL # <<<<<<<<<<<<<< * if self.i == PyList_GET_SIZE(self.matches): * while obj is NULL: */ __pyx_v_obj = NULL; /* "cytoolz/itertoolz.pyx":1530 * def __next__(self): * cdef PyObject *obj = NULL * if self.i == PyList_GET_SIZE(self.matches): # <<<<<<<<<<<<<< * while obj is NULL: * self.right = next(self.rightseq) */ __pyx_t_1 = __pyx_v_self->__pyx_base.matches; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = ((__pyx_v_self->__pyx_base.i == PyList_GET_SIZE(__pyx_t_1)) != 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":1531 * cdef PyObject *obj = NULL * if self.i == PyList_GET_SIZE(self.matches): * while obj is NULL: # <<<<<<<<<<<<<< * self.right = next(self.rightseq) * key = self.rightkey() */ while (1) { __pyx_t_2 = ((__pyx_v_obj == NULL) != 0); if (!__pyx_t_2) break; /* "cytoolz/itertoolz.pyx":1532 * if self.i == PyList_GET_SIZE(self.matches): * while obj is NULL: * self.right = next(self.rightseq) # <<<<<<<<<<<<<< * key = self.rightkey() * obj = PyDict_GetItem(self.d, key) */ __pyx_t_1 = __pyx_v_self->__pyx_base.rightseq; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->__pyx_base.right); __Pyx_DECREF(__pyx_v_self->__pyx_base.right); __pyx_v_self->__pyx_base.right = __pyx_t_3; __pyx_t_3 = 0; /* "cytoolz/itertoolz.pyx":1533 * while obj is NULL: * self.right = next(self.rightseq) * key = self.rightkey() # <<<<<<<<<<<<<< * obj = PyDict_GetItem(self.d, key) * self.matches = obj */ __pyx_t_3 = ((struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.rightkey(((struct __pyx_obj_7cytoolz_9itertoolz__join *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/itertoolz.pyx":1534 * self.right = next(self.rightseq) * key = self.rightkey() * obj = PyDict_GetItem(self.d, key) # <<<<<<<<<<<<<< * self.matches = obj * self.i = 0 */ __pyx_t_3 = __pyx_v_self->__pyx_base.d; __Pyx_INCREF(__pyx_t_3); __pyx_v_obj = PyDict_GetItem(__pyx_t_3, __pyx_v_key); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } /* "cytoolz/itertoolz.pyx":1535 * key = self.rightkey() * obj = PyDict_GetItem(self.d, key) * self.matches = obj # <<<<<<<<<<<<<< * self.i = 0 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking */ if (!(likely(PyList_CheckExact(((PyObject *)__pyx_v_obj)))||((((PyObject *)__pyx_v_obj)) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(((PyObject *)__pyx_v_obj))->tp_name), 0))) __PYX_ERR(0, 1535, __pyx_L1_error) __pyx_t_3 = ((PyObject *)__pyx_v_obj); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __Pyx_GOTREF(__pyx_v_self->__pyx_base.matches); __Pyx_DECREF(__pyx_v_self->__pyx_base.matches); __pyx_v_self->__pyx_base.matches = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; /* "cytoolz/itertoolz.pyx":1536 * obj = PyDict_GetItem(self.d, key) * self.matches = obj * self.i = 0 # <<<<<<<<<<<<<< * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking * self.i += 1 */ __pyx_v_self->__pyx_base.i = 0; /* "cytoolz/itertoolz.pyx":1530 * def __next__(self): * cdef PyObject *obj = NULL * if self.i == PyList_GET_SIZE(self.matches): # <<<<<<<<<<<<<< * while obj is NULL: * self.right = next(self.rightseq) */ } /* "cytoolz/itertoolz.pyx":1537 * self.matches = obj * self.i = 0 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking # <<<<<<<<<<<<<< * self.i += 1 * return (match, self.right) */ __pyx_t_3 = __pyx_v_self->__pyx_base.matches; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_v_self->__pyx_base.i); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = ((PyObject *)__pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_v_match = __pyx_t_3; __pyx_t_3 = 0; /* "cytoolz/itertoolz.pyx":1538 * self.i = 0 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking * self.i += 1 # <<<<<<<<<<<<<< * return (match, self.right) * */ __pyx_v_self->__pyx_base.i = (__pyx_v_self->__pyx_base.i + 1); /* "cytoolz/itertoolz.pyx":1539 * match = PyList_GET_ITEM(self.matches, self.i) # skip error checking * self.i += 1 * return (match, self.right) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_match); __Pyx_GIVEREF(__pyx_v_match); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_match); __Pyx_INCREF(__pyx_v_self->__pyx_base.right); __Pyx_GIVEREF(__pyx_v_self->__pyx_base.right); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->__pyx_base.right); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1528 * * cdef class _inner_join(_join): * def __next__(self): # <<<<<<<<<<<<<< * cdef PyObject *obj = NULL * if self.i == PyList_GET_SIZE(self.matches): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.itertoolz._inner_join.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_match); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_inner_join_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_11_inner_join_2__reduce_cython__[] = "_inner_join.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_11_inner_join_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11_inner_join_3__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_11_inner_join_2__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_inner_join_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_inner_join_2__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__inner_join *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_inner_join_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__inner_join *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._inner_join.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_inner_join_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_11_inner_join_4__setstate_cython__[] = "_inner_join.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_11_inner_join_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11_inner_join_5__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_11_inner_join_4__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_11_inner_join_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_11_inner_join_4__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__inner_join *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_11_inner_join_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__inner_join *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._inner_join.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1543 * * cdef class _inner_join_key(_inner_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * return self._rightkey(self.right) * */ static PyObject *__pyx_f_7cytoolz_9itertoolz_15_inner_join_key_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("rightkey", 0); /* "cytoolz/itertoolz.pyx":1544 * cdef class _inner_join_key(_inner_join): * cdef object rightkey(self): * return self._rightkey(self.right) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_self->__pyx_base.__pyx_base._rightkey); __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base._rightkey; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_self->__pyx_base.__pyx_base.right) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->__pyx_base.__pyx_base.right); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1544, __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; /* "cytoolz/itertoolz.pyx":1543 * * cdef class _inner_join_key(_inner_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * return self._rightkey(self.right) * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("cytoolz.itertoolz._inner_join_key.rightkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_15_inner_join_key_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_15_inner_join_key___reduce_cython__[] = "_inner_join_key.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_15_inner_join_key_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_15_inner_join_key_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_15_inner_join_key___reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_15_inner_join_key_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_15_inner_join_key___reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_15_inner_join_key___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._inner_join_key.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_15_inner_join_key_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_15_inner_join_key_2__setstate_cython__[] = "_inner_join_key.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_15_inner_join_key_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_15_inner_join_key_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_15_inner_join_key_2__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_15_inner_join_key_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_15_inner_join_key_2__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_15_inner_join_key_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._inner_join_key.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1548 * * cdef class _inner_join_index(_inner_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * return self.right[self._rightkey] * */ static PyObject *__pyx_f_7cytoolz_9itertoolz_17_inner_join_index_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("rightkey", 0); /* "cytoolz/itertoolz.pyx":1549 * cdef class _inner_join_index(_inner_join): * cdef object rightkey(self): * return self.right[self._rightkey] # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->__pyx_base.__pyx_base.right, __pyx_v_self->__pyx_base.__pyx_base._rightkey); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1548 * * cdef class _inner_join_index(_inner_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * return self.right[self._rightkey] * */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._inner_join_index.rightkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_inner_join_index_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_17_inner_join_index___reduce_cython__[] = "_inner_join_index.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_17_inner_join_index_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_17_inner_join_index_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_17_inner_join_index___reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_inner_join_index_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_17_inner_join_index___reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_inner_join_index___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._inner_join_index.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_inner_join_index_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_17_inner_join_index_2__setstate_cython__[] = "_inner_join_index.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_17_inner_join_index_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_17_inner_join_index_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_17_inner_join_index_2__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_17_inner_join_index_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_17_inner_join_index_2__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_17_inner_join_index_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._inner_join_index.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1553 * * cdef class _inner_join_indices(_inner_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * keyval = PyTuple_New(self.N) * for i in range(self.N): */ static PyObject *__pyx_f_7cytoolz_9itertoolz_19_inner_join_indices_rightkey(struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices *__pyx_v_self) { PyObject *__pyx_v_keyval = NULL; Py_ssize_t __pyx_v_i; PyObject *__pyx_v_val = NULL; 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; __Pyx_RefNannySetupContext("rightkey", 0); /* "cytoolz/itertoolz.pyx":1554 * cdef class _inner_join_indices(_inner_join): * cdef object rightkey(self): * keyval = PyTuple_New(self.N) # <<<<<<<<<<<<<< * for i in range(self.N): * val = PyList_GET_ITEM(self._rightkey, i) */ __pyx_t_1 = PyTuple_New(__pyx_v_self->__pyx_base.__pyx_base.N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1554, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_keyval = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1555 * cdef object rightkey(self): * keyval = PyTuple_New(self.N) * for i in range(self.N): # <<<<<<<<<<<<<< * val = PyList_GET_ITEM(self._rightkey, i) * val = self.right[val] */ __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx_base.N; __pyx_t_3 = __pyx_t_2; for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_i = __pyx_t_4; /* "cytoolz/itertoolz.pyx":1556 * keyval = PyTuple_New(self.N) * for i in range(self.N): * val = PyList_GET_ITEM(self._rightkey, i) # <<<<<<<<<<<<<< * val = self.right[val] * Py_INCREF(val) */ __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx_base._rightkey; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_v_i); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = ((PyObject *)__pyx_t_5); __Pyx_INCREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1557 * for i in range(self.N): * val = PyList_GET_ITEM(self._rightkey, i) * val = self.right[val] # <<<<<<<<<<<<<< * Py_INCREF(val) * PyTuple_SET_ITEM(keyval, i, val) */ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->__pyx_base.__pyx_base.right, __pyx_v_val); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_val, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1558 * val = PyList_GET_ITEM(self._rightkey, i) * val = self.right[val] * Py_INCREF(val) # <<<<<<<<<<<<<< * PyTuple_SET_ITEM(keyval, i, val) * return keyval */ Py_INCREF(__pyx_v_val); /* "cytoolz/itertoolz.pyx":1559 * val = self.right[val] * Py_INCREF(val) * PyTuple_SET_ITEM(keyval, i, val) # <<<<<<<<<<<<<< * return keyval * */ PyTuple_SET_ITEM(__pyx_v_keyval, __pyx_v_i, __pyx_v_val); } /* "cytoolz/itertoolz.pyx":1560 * Py_INCREF(val) * PyTuple_SET_ITEM(keyval, i, val) * return keyval # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_keyval); __pyx_r = __pyx_v_keyval; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1553 * * cdef class _inner_join_indices(_inner_join): * cdef object rightkey(self): # <<<<<<<<<<<<<< * keyval = PyTuple_New(self.N) * for i in range(self.N): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._inner_join_indices.rightkey", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_keyval); __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_19_inner_join_indices_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_19_inner_join_indices___reduce_cython__[] = "_inner_join_indices.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_19_inner_join_indices_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_19_inner_join_indices_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_19_inner_join_indices___reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_19_inner_join_indices_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_19_inner_join_indices___reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_19_inner_join_indices___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._inner_join_indices.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_19_inner_join_indices_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_19_inner_join_indices_2__setstate_cython__[] = "_inner_join_indices.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_19_inner_join_indices_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_19_inner_join_indices_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_19_inner_join_indices_2__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_19_inner_join_indices_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_19_inner_join_indices_2__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_19_inner_join_indices_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._inner_join_indices.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1564 * * cdef class _diff_key: * def __cinit__(self, object seqs, object key, object default=no_default): # <<<<<<<<<<<<<< * self.N = len(seqs) * if self.N < 2: */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9itertoolz_9_diff_key_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9itertoolz_9_diff_key_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_seqs = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_v_default = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seqs,&__pyx_n_s_key,&__pyx_n_s_default,0}; PyObject* values[3] = {0,0,0}; values[2] = __pyx_k__73; 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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seqs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(0, 1564, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__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, "__cinit__") < 0)) __PYX_ERR(0, 1564, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; 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_seqs = values[0]; __pyx_v_key = values[1]; __pyx_v_default = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1564, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz._diff_key.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_9_diff_key___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__diff_key *)__pyx_v_self), __pyx_v_seqs, __pyx_v_key, __pyx_v_default); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9itertoolz_9_diff_key___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__diff_key *__pyx_v_self, PyObject *__pyx_v_seqs, PyObject *__pyx_v_key, PyObject *__pyx_v_default) { int __pyx_r; __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; __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/itertoolz.pyx":1565 * cdef class _diff_key: * def __cinit__(self, object seqs, object key, object default=no_default): * self.N = len(seqs) # <<<<<<<<<<<<<< * if self.N < 2: * raise TypeError('Too few sequences given (min 2 required)') */ __pyx_t_1 = PyObject_Length(__pyx_v_seqs); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1565, __pyx_L1_error) __pyx_v_self->N = __pyx_t_1; /* "cytoolz/itertoolz.pyx":1566 * def __cinit__(self, object seqs, object key, object default=no_default): * self.N = len(seqs) * if self.N < 2: # <<<<<<<<<<<<<< * raise TypeError('Too few sequences given (min 2 required)') * if default == no_default: */ __pyx_t_2 = ((__pyx_v_self->N < 2) != 0); if (unlikely(__pyx_t_2)) { /* "cytoolz/itertoolz.pyx":1567 * self.N = len(seqs) * if self.N < 2: * raise TypeError('Too few sequences given (min 2 required)') # <<<<<<<<<<<<<< * if default == no_default: * self.iters = zip(*seqs) */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1567, __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_ERR(0, 1567, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":1566 * def __cinit__(self, object seqs, object key, object default=no_default): * self.N = len(seqs) * if self.N < 2: # <<<<<<<<<<<<<< * raise TypeError('Too few sequences given (min 2 required)') * if default == no_default: */ } /* "cytoolz/itertoolz.pyx":1568 * if self.N < 2: * raise TypeError('Too few sequences given (min 2 required)') * if default == no_default: # <<<<<<<<<<<<<< * self.iters = zip(*seqs) * else: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_no_default); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_v_default, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1568, __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_ERR(0, 1568, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":1569 * raise TypeError('Too few sequences given (min 2 required)') * if default == no_default: * self.iters = zip(*seqs) # <<<<<<<<<<<<<< * else: * self.iters = zip_longest(*seqs, fillvalue=default) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_zip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_seqs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1569, __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_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->iters); __Pyx_DECREF(__pyx_v_self->iters); __pyx_v_self->iters = __pyx_t_5; __pyx_t_5 = 0; /* "cytoolz/itertoolz.pyx":1568 * if self.N < 2: * raise TypeError('Too few sequences given (min 2 required)') * if default == no_default: # <<<<<<<<<<<<<< * self.iters = zip(*seqs) * else: */ goto __pyx_L4; } /* "cytoolz/itertoolz.pyx":1571 * self.iters = zip(*seqs) * else: * self.iters = zip_longest(*seqs, fillvalue=default) # <<<<<<<<<<<<<< * self.key = key * */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_zip_longest); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_seqs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1571, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fillvalue, __pyx_v_default) < 0) __PYX_ERR(0, 1571, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1571, __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; __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_v_self->iters); __Pyx_DECREF(__pyx_v_self->iters); __pyx_v_self->iters = __pyx_t_6; __pyx_t_6 = 0; } __pyx_L4:; /* "cytoolz/itertoolz.pyx":1572 * else: * self.iters = zip_longest(*seqs, fillvalue=default) * self.key = key # <<<<<<<<<<<<<< * * def __iter__(self): */ __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); __Pyx_GOTREF(__pyx_v_self->key); __Pyx_DECREF(__pyx_v_self->key); __pyx_v_self->key = __pyx_v_key; /* "cytoolz/itertoolz.pyx":1564 * * cdef class _diff_key: * def __cinit__(self, object seqs, object key, object default=no_default): # <<<<<<<<<<<<<< * self.N = len(seqs) * if self.N < 2: */ /* 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_AddTraceback("cytoolz.itertoolz._diff_key.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1574 * self.key = key * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_9_diff_key_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_9_diff_key_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_9_diff_key_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz__diff_key *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_9_diff_key_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__diff_key *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* "cytoolz/itertoolz.pyx":1575 * * 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; /* "cytoolz/itertoolz.pyx":1574 * self.key = key * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1577 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef object val, val2, items * cdef Py_ssize_t i */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_9_diff_key_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_9_diff_key_5__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_9_diff_key_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz__diff_key *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_9_diff_key_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__diff_key *__pyx_v_self) { PyObject *__pyx_v_val = 0; PyObject *__pyx_v_val2 = 0; PyObject *__pyx_v_items = 0; Py_ssize_t __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3; PyObject *__pyx_t_4 = NULL; Py_ssize_t __pyx_t_5; Py_ssize_t __pyx_t_6; Py_ssize_t __pyx_t_7; int __pyx_t_8; int __pyx_t_9; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":1580 * cdef object val, val2, items * cdef Py_ssize_t i * while True: # <<<<<<<<<<<<<< * items = next(self.iters) * val = self.key(PyTuple_GET_ITEM(items, 0)) */ while (1) { /* "cytoolz/itertoolz.pyx":1581 * cdef Py_ssize_t i * while True: * items = next(self.iters) # <<<<<<<<<<<<<< * val = self.key(PyTuple_GET_ITEM(items, 0)) * for i in range(1, self.N): */ __pyx_t_1 = __pyx_v_self->iters; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_items, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1582 * while True: * items = next(self.iters) * val = self.key(PyTuple_GET_ITEM(items, 0)) # <<<<<<<<<<<<<< * for i in range(1, self.N): * val2 = self.key(PyTuple_GET_ITEM(items, i)) */ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_v_items, 0); __Pyx_INCREF(__pyx_v_self->key); __pyx_t_1 = __pyx_v_self->key; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, ((PyObject *)__pyx_t_3)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_t_3)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1582, __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; /* "cytoolz/itertoolz.pyx":1583 * items = next(self.iters) * val = self.key(PyTuple_GET_ITEM(items, 0)) * for i in range(1, self.N): # <<<<<<<<<<<<<< * val2 = self.key(PyTuple_GET_ITEM(items, i)) * if PyObject_RichCompareBool(val, val2, Py_NE): */ __pyx_t_5 = __pyx_v_self->N; __pyx_t_6 = __pyx_t_5; for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { __pyx_v_i = __pyx_t_7; /* "cytoolz/itertoolz.pyx":1584 * val = self.key(PyTuple_GET_ITEM(items, 0)) * for i in range(1, self.N): * val2 = self.key(PyTuple_GET_ITEM(items, i)) # <<<<<<<<<<<<<< * if PyObject_RichCompareBool(val, val2, Py_NE): * return items */ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_v_items, __pyx_v_i); __Pyx_INCREF(__pyx_v_self->key); __pyx_t_1 = __pyx_v_self->key; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); } } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, ((PyObject *)__pyx_t_3)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_t_3)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_val2, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1585 * for i in range(1, self.N): * val2 = self.key(PyTuple_GET_ITEM(items, i)) * if PyObject_RichCompareBool(val, val2, Py_NE): # <<<<<<<<<<<<<< * return items * */ __pyx_t_8 = PyObject_RichCompareBool(__pyx_v_val, __pyx_v_val2, Py_NE); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1585, __pyx_L1_error) __pyx_t_9 = (__pyx_t_8 != 0); if (__pyx_t_9) { /* "cytoolz/itertoolz.pyx":1586 * val2 = self.key(PyTuple_GET_ITEM(items, i)) * if PyObject_RichCompareBool(val, val2, Py_NE): * return items # <<<<<<<<<<<<<< * * cdef class _diff_identity: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_items); __pyx_r = __pyx_v_items; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1585 * for i in range(1, self.N): * val2 = self.key(PyTuple_GET_ITEM(items, i)) * if PyObject_RichCompareBool(val, val2, Py_NE): # <<<<<<<<<<<<<< * return items * */ } } } /* "cytoolz/itertoolz.pyx":1577 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef object val, val2, items * cdef Py_ssize_t 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_4); __Pyx_AddTraceback("cytoolz.itertoolz._diff_key.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_val); __Pyx_XDECREF(__pyx_v_val2); __Pyx_XDECREF(__pyx_v_items); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_9_diff_key_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_9_diff_key_6__reduce_cython__[] = "_diff_key.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_9_diff_key_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_9_diff_key_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_9_diff_key_6__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_9_diff_key_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_9_diff_key_6__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__diff_key *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_9_diff_key_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__diff_key *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._diff_key.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_9_diff_key_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_9_diff_key_8__setstate_cython__[] = "_diff_key.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_9_diff_key_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_9_diff_key_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_9_diff_key_8__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_9_diff_key_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_9_diff_key_8__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__diff_key *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_9_diff_key_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__diff_key *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._diff_key.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1589 * * cdef class _diff_identity: * def __cinit__(self, object seqs, object default=no_default): # <<<<<<<<<<<<<< * self.N = len(seqs) * if self.N < 2: */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9itertoolz_14_diff_identity_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9itertoolz_14_diff_identity_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_seqs = 0; PyObject *__pyx_v_default = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_seqs,&__pyx_n_s_default,0}; PyObject* values[2] = {0,0}; values[1] = __pyx_k__77; 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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seqs)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_default); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1589, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } __pyx_v_seqs = values[0]; __pyx_v_default = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1589, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz._diff_identity.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_14_diff_identity___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *)__pyx_v_self), __pyx_v_seqs, __pyx_v_default); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9itertoolz_14_diff_identity___cinit__(struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *__pyx_v_self, PyObject *__pyx_v_seqs, PyObject *__pyx_v_default) { int __pyx_r; __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; __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/itertoolz.pyx":1590 * cdef class _diff_identity: * def __cinit__(self, object seqs, object default=no_default): * self.N = len(seqs) # <<<<<<<<<<<<<< * if self.N < 2: * raise TypeError('Too few sequences given (min 2 required)') */ __pyx_t_1 = PyObject_Length(__pyx_v_seqs); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1590, __pyx_L1_error) __pyx_v_self->N = __pyx_t_1; /* "cytoolz/itertoolz.pyx":1591 * def __cinit__(self, object seqs, object default=no_default): * self.N = len(seqs) * if self.N < 2: # <<<<<<<<<<<<<< * raise TypeError('Too few sequences given (min 2 required)') * if default == no_default: */ __pyx_t_2 = ((__pyx_v_self->N < 2) != 0); if (unlikely(__pyx_t_2)) { /* "cytoolz/itertoolz.pyx":1592 * self.N = len(seqs) * if self.N < 2: * raise TypeError('Too few sequences given (min 2 required)') # <<<<<<<<<<<<<< * if default == no_default: * self.iters = zip(*seqs) */ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1592, __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_ERR(0, 1592, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":1591 * def __cinit__(self, object seqs, object default=no_default): * self.N = len(seqs) * if self.N < 2: # <<<<<<<<<<<<<< * raise TypeError('Too few sequences given (min 2 required)') * if default == no_default: */ } /* "cytoolz/itertoolz.pyx":1593 * if self.N < 2: * raise TypeError('Too few sequences given (min 2 required)') * if default == no_default: # <<<<<<<<<<<<<< * self.iters = zip(*seqs) * else: */ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_no_default); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_RichCompare(__pyx_v_default, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1593, __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_ERR(0, 1593, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":1594 * raise TypeError('Too few sequences given (min 2 required)') * if default == no_default: * self.iters = zip(*seqs) # <<<<<<<<<<<<<< * else: * self.iters = zip_longest(*seqs, fillvalue=default) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_zip); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_seqs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1594, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1594, __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_GIVEREF(__pyx_t_5); __Pyx_GOTREF(__pyx_v_self->iters); __Pyx_DECREF(__pyx_v_self->iters); __pyx_v_self->iters = __pyx_t_5; __pyx_t_5 = 0; /* "cytoolz/itertoolz.pyx":1593 * if self.N < 2: * raise TypeError('Too few sequences given (min 2 required)') * if default == no_default: # <<<<<<<<<<<<<< * self.iters = zip(*seqs) * else: */ goto __pyx_L4; } /* "cytoolz/itertoolz.pyx":1596 * self.iters = zip(*seqs) * else: * self.iters = zip_longest(*seqs, fillvalue=default) # <<<<<<<<<<<<<< * * def __iter__(self): */ /*else*/ { __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_zip_longest); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_seqs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1596, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fillvalue, __pyx_v_default) < 0) __PYX_ERR(0, 1596, __pyx_L1_error) __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1596, __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; __Pyx_GIVEREF(__pyx_t_6); __Pyx_GOTREF(__pyx_v_self->iters); __Pyx_DECREF(__pyx_v_self->iters); __pyx_v_self->iters = __pyx_t_6; __pyx_t_6 = 0; } __pyx_L4:; /* "cytoolz/itertoolz.pyx":1589 * * cdef class _diff_identity: * def __cinit__(self, object seqs, object default=no_default): # <<<<<<<<<<<<<< * self.N = len(seqs) * if self.N < 2: */ /* 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_AddTraceback("cytoolz.itertoolz._diff_identity.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1598 * self.iters = zip_longest(*seqs, fillvalue=default) * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_14_diff_identity_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_14_diff_identity_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_14_diff_identity_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_14_diff_identity_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* "cytoolz/itertoolz.pyx":1599 * * 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; /* "cytoolz/itertoolz.pyx":1598 * self.iters = zip_longest(*seqs, fillvalue=default) * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1601 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef object val, val2, items * cdef Py_ssize_t i */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_14_diff_identity_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_14_diff_identity_5__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_14_diff_identity_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_14_diff_identity_4__next__(struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *__pyx_v_self) { PyObject *__pyx_v_val = 0; PyObject *__pyx_v_val2 = 0; PyObject *__pyx_v_items = 0; Py_ssize_t __pyx_v_i; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3; Py_ssize_t __pyx_t_4; Py_ssize_t __pyx_t_5; Py_ssize_t __pyx_t_6; int __pyx_t_7; int __pyx_t_8; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":1604 * cdef object val, val2, items * cdef Py_ssize_t i * while True: # <<<<<<<<<<<<<< * items = next(self.iters) * val = PyTuple_GET_ITEM(items, 0) */ while (1) { /* "cytoolz/itertoolz.pyx":1605 * cdef Py_ssize_t i * while True: * items = next(self.iters) # <<<<<<<<<<<<<< * val = PyTuple_GET_ITEM(items, 0) * for i in range(1, self.N): */ __pyx_t_1 = __pyx_v_self->iters; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_items, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1606 * while True: * items = next(self.iters) * val = PyTuple_GET_ITEM(items, 0) # <<<<<<<<<<<<<< * for i in range(1, self.N): * val2 = PyTuple_GET_ITEM(items, i) */ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_v_items, 0); __pyx_t_2 = ((PyObject *)__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1607 * items = next(self.iters) * val = PyTuple_GET_ITEM(items, 0) * for i in range(1, self.N): # <<<<<<<<<<<<<< * val2 = PyTuple_GET_ITEM(items, i) * if PyObject_RichCompareBool(val, val2, Py_NE): */ __pyx_t_4 = __pyx_v_self->N; __pyx_t_5 = __pyx_t_4; for (__pyx_t_6 = 1; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6; /* "cytoolz/itertoolz.pyx":1608 * val = PyTuple_GET_ITEM(items, 0) * for i in range(1, self.N): * val2 = PyTuple_GET_ITEM(items, i) # <<<<<<<<<<<<<< * if PyObject_RichCompareBool(val, val2, Py_NE): * return items */ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_v_items, __pyx_v_i); __pyx_t_2 = ((PyObject *)__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_val2, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1609 * for i in range(1, self.N): * val2 = PyTuple_GET_ITEM(items, i) * if PyObject_RichCompareBool(val, val2, Py_NE): # <<<<<<<<<<<<<< * return items * */ __pyx_t_7 = PyObject_RichCompareBool(__pyx_v_val, __pyx_v_val2, Py_NE); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 1609, __pyx_L1_error) __pyx_t_8 = (__pyx_t_7 != 0); if (__pyx_t_8) { /* "cytoolz/itertoolz.pyx":1610 * val2 = PyTuple_GET_ITEM(items, i) * if PyObject_RichCompareBool(val, val2, Py_NE): * return items # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_items); __pyx_r = __pyx_v_items; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1609 * for i in range(1, self.N): * val2 = PyTuple_GET_ITEM(items, i) * if PyObject_RichCompareBool(val, val2, Py_NE): # <<<<<<<<<<<<<< * return items * */ } } } /* "cytoolz/itertoolz.pyx":1601 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef object val, val2, items * cdef Py_ssize_t 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_AddTraceback("cytoolz.itertoolz._diff_identity.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_val); __Pyx_XDECREF(__pyx_v_val2); __Pyx_XDECREF(__pyx_v_items); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_14_diff_identity_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_14_diff_identity_6__reduce_cython__[] = "_diff_identity.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_14_diff_identity_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_14_diff_identity_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_14_diff_identity_6__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_14_diff_identity_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_14_diff_identity_6__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_14_diff_identity_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._diff_identity.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_14_diff_identity_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_14_diff_identity_8__setstate_cython__[] = "_diff_identity.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_14_diff_identity_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_14_diff_identity_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_14_diff_identity_8__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_14_diff_identity_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_14_diff_identity_8__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_14_diff_identity_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz._diff_identity.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1613 * * * cdef object c_diff(object seqs, object default=no_default, object key=None): # <<<<<<<<<<<<<< * if key is None: * return _diff_identity(seqs, default=default) */ static PyObject *__pyx_f_7cytoolz_9itertoolz_c_diff(PyObject *__pyx_v_seqs, struct __pyx_opt_args_7cytoolz_9itertoolz_c_diff *__pyx_optional_args) { PyObject *__pyx_v_default = __pyx_k__80; PyObject *__pyx_v_key = ((PyObject *)Py_None); 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; __Pyx_RefNannySetupContext("c_diff", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_default = __pyx_optional_args->__pyx_default; if (__pyx_optional_args->__pyx_n > 1) { __pyx_v_key = __pyx_optional_args->key; } } } /* "cytoolz/itertoolz.pyx":1614 * * cdef object c_diff(object seqs, object default=no_default, object key=None): * if key is None: # <<<<<<<<<<<<<< * return _diff_identity(seqs, default=default) * else: */ __pyx_t_1 = (__pyx_v_key == Py_None); __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":1615 * cdef object c_diff(object seqs, object default=no_default, object key=None): * if key is None: * return _diff_identity(seqs, default=default) # <<<<<<<<<<<<<< * else: * return _diff_key(seqs, key, default=default) */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_seqs); __Pyx_GIVEREF(__pyx_v_seqs); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_seqs); __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1615, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_default, __pyx_v_default) < 0) __PYX_ERR(0, 1615, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__diff_identity), __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1615, __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_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1614 * * cdef object c_diff(object seqs, object default=no_default, object key=None): * if key is None: # <<<<<<<<<<<<<< * return _diff_identity(seqs, default=default) * else: */ } /* "cytoolz/itertoolz.pyx":1617 * return _diff_identity(seqs, default=default) * else: * return _diff_key(seqs, key, default=default) # <<<<<<<<<<<<<< * * */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_seqs); __Pyx_GIVEREF(__pyx_v_seqs); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_seqs); __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_key); __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_default, __pyx_v_default) < 0) __PYX_ERR(0, 1617, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__diff_key), __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1617, __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 = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; } /* "cytoolz/itertoolz.pyx":1613 * * * cdef object c_diff(object seqs, object default=no_default, object key=None): # <<<<<<<<<<<<<< * if key is None: * return _diff_identity(seqs, default=default) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("cytoolz.itertoolz.c_diff", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1620 * * * def diff(*seqs, **kwargs): # <<<<<<<<<<<<<< * """ * Return those items that differ between sequences */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_55diff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_54diff[] = "diff(*seqs, **kwargs)\n\n Return those items that differ between sequences\n\n >>> list(diff([1, 2, 3], [1, 2, 10, 100]))\n [(3, 10)]\n\n Shorter sequences may be padded with a ``default`` value:\n\n >>> list(diff([1, 2, 3], [1, 2, 10, 100], default=None))\n [(3, 10), (None, 100)]\n\n A ``key`` function may also be applied to each item to use during\n comparisons:\n\n >>> list(diff(['apples', 'bananas'], ['Apples', 'Oranges'], key=str.lower))\n [('bananas', 'Oranges')]\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_55diff = {"diff", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9itertoolz_55diff, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9itertoolz_54diff}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_55diff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_seqs = 0; PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("diff (wrapper)", 0); if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "diff", 1))) return NULL; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); __Pyx_INCREF(__pyx_args); __pyx_v_seqs = __pyx_args; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_54diff(__pyx_self, __pyx_v_seqs, __pyx_v_kwargs); /* function exit code */ __Pyx_XDECREF(__pyx_v_seqs); __Pyx_XDECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_54diff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seqs, PyObject *__pyx_v_kwargs) { Py_ssize_t __pyx_v_N; PyObject *__pyx_v_default = NULL; PyObject *__pyx_v_key = NULL; 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; PyObject *__pyx_t_6 = NULL; struct __pyx_opt_args_7cytoolz_9itertoolz_c_diff __pyx_t_7; __Pyx_RefNannySetupContext("diff", 0); __Pyx_INCREF(__pyx_v_seqs); /* "cytoolz/itertoolz.pyx":1638 * [('bananas', 'Oranges')] * """ * N = len(seqs) # <<<<<<<<<<<<<< * if N == 1 and isinstance(seqs[0], list): * seqs = seqs[0] */ __pyx_t_1 = PyObject_Length(__pyx_v_seqs); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1638, __pyx_L1_error) __pyx_v_N = __pyx_t_1; /* "cytoolz/itertoolz.pyx":1639 * """ * N = len(seqs) * if N == 1 and isinstance(seqs[0], list): # <<<<<<<<<<<<<< * seqs = seqs[0] * default = kwargs.get('default', no_default) */ __pyx_t_3 = ((__pyx_v_N == 1) != 0); if (__pyx_t_3) { } else { __pyx_t_2 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_seqs, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = PyList_Check(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = (__pyx_t_3 != 0); __pyx_t_2 = __pyx_t_5; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":1640 * N = len(seqs) * if N == 1 and isinstance(seqs[0], list): * seqs = seqs[0] # <<<<<<<<<<<<<< * default = kwargs.get('default', no_default) * key = kwargs.get('key') */ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_seqs, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_seqs, __pyx_t_4); __pyx_t_4 = 0; /* "cytoolz/itertoolz.pyx":1639 * """ * N = len(seqs) * if N == 1 and isinstance(seqs[0], list): # <<<<<<<<<<<<<< * seqs = seqs[0] * default = kwargs.get('default', no_default) */ } /* "cytoolz/itertoolz.pyx":1641 * if N == 1 and isinstance(seqs[0], list): * seqs = seqs[0] * default = kwargs.get('default', no_default) # <<<<<<<<<<<<<< * key = kwargs.get('key') * return c_diff(seqs, default=default, key=key) */ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_no_default); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_s_default, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_default = __pyx_t_6; __pyx_t_6 = 0; /* "cytoolz/itertoolz.pyx":1642 * seqs = seqs[0] * default = kwargs.get('default', no_default) * key = kwargs.get('key') # <<<<<<<<<<<<<< * return c_diff(seqs, default=default, key=key) * */ __pyx_t_6 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_s_key, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_v_key = __pyx_t_6; __pyx_t_6 = 0; /* "cytoolz/itertoolz.pyx":1643 * default = kwargs.get('default', no_default) * key = kwargs.get('key') * return c_diff(seqs, default=default, key=key) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_7.__pyx_n = 2; __pyx_t_7.__pyx_default = __pyx_v_default; __pyx_t_7.key = __pyx_v_key; __pyx_t_6 = __pyx_f_7cytoolz_9itertoolz_c_diff(__pyx_v_seqs, &__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1620 * * * def diff(*seqs, **kwargs): # <<<<<<<<<<<<<< * """ * Return those items that differ between sequences */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("cytoolz.itertoolz.diff", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_seqs); __Pyx_XDECREF(__pyx_v_default); __Pyx_XDECREF(__pyx_v_key); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1646 * * * cpdef object topk(Py_ssize_t k, object seq, object key=None): # <<<<<<<<<<<<<< * """ * Find the k largest elements of a sequence */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_57topk(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_topk(Py_ssize_t __pyx_v_k, PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_topk *__pyx_optional_args) { PyObject *__pyx_v_key = ((PyObject *)Py_None); PyObject *__pyx_v_item = 0; PyObject *__pyx_v_val = 0; PyObject *__pyx_v_top = 0; PyObject *__pyx_v_it = 0; PyObject *__pyx_v__heapreplace = 0; Py_ssize_t __pyx_v_i; PyObject *__pyx_v_pq = 0; 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; Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *(*__pyx_t_10)(PyObject *); PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; __Pyx_RefNannySetupContext("topk", 0); if (__pyx_optional_args) { if (__pyx_optional_args->__pyx_n > 0) { __pyx_v_key = __pyx_optional_args->key; } } __Pyx_INCREF(__pyx_v_key); /* "cytoolz/itertoolz.pyx":1664 * """ * cdef object item, val, top * cdef object it = iter(seq) # <<<<<<<<<<<<<< * cdef object _heapreplace = heapreplace * cdef Py_ssize_t i = k */ __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1664, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_it = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1665 * cdef object item, val, top * cdef object it = iter(seq) * cdef object _heapreplace = heapreplace # <<<<<<<<<<<<<< * cdef Py_ssize_t i = k * cdef list pq = [] */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_heapreplace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1665, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v__heapreplace = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1666 * cdef object it = iter(seq) * cdef object _heapreplace = heapreplace * cdef Py_ssize_t i = k # <<<<<<<<<<<<<< * cdef list pq = [] * */ __pyx_v_i = __pyx_v_k; /* "cytoolz/itertoolz.pyx":1667 * cdef object _heapreplace = heapreplace * cdef Py_ssize_t i = k * cdef list pq = [] # <<<<<<<<<<<<<< * * if key is not None and not callable(key): */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_pq = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1669 * cdef list pq = [] * * if key is not None and not callable(key): # <<<<<<<<<<<<<< * key = getter(key) * */ __pyx_t_3 = (__pyx_v_key != Py_None); __pyx_t_4 = (__pyx_t_3 != 0); if (__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } __pyx_t_4 = __Pyx_PyCallable_Check(__pyx_v_key); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 1669, __pyx_L1_error) __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0); __pyx_t_2 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":1670 * * if key is not None and not callable(key): * key = getter(key) # <<<<<<<<<<<<<< * * if k < 2: */ __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_getter(__pyx_v_key, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1669 * cdef list pq = [] * * if key is not None and not callable(key): # <<<<<<<<<<<<<< * key = getter(key) * */ } /* "cytoolz/itertoolz.pyx":1672 * key = getter(key) * * if k < 2: # <<<<<<<<<<<<<< * if k < 1: * return () */ __pyx_t_2 = ((__pyx_v_k < 2) != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":1673 * * if k < 2: * if k < 1: # <<<<<<<<<<<<<< * return () * top = list(take(1, it)) */ __pyx_t_2 = ((__pyx_v_k < 1) != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":1674 * if k < 2: * if k < 1: * return () # <<<<<<<<<<<<<< * top = list(take(1, it)) * if len(top) == 0: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_empty_tuple); __pyx_r = __pyx_empty_tuple; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1673 * * if k < 2: * if k < 1: # <<<<<<<<<<<<<< * return () * top = list(take(1, it)) */ } /* "cytoolz/itertoolz.pyx":1675 * if k < 1: * return () * top = list(take(1, it)) # <<<<<<<<<<<<<< * if len(top) == 0: * return () */ __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_take(1, __pyx_v_it, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_top = __pyx_t_5; __pyx_t_5 = 0; /* "cytoolz/itertoolz.pyx":1676 * return () * top = list(take(1, it)) * if len(top) == 0: # <<<<<<<<<<<<<< * return () * it = concatv(top, it) */ __pyx_t_6 = PyObject_Length(__pyx_v_top); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1676, __pyx_L1_error) __pyx_t_2 = ((__pyx_t_6 == 0) != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":1677 * top = list(take(1, it)) * if len(top) == 0: * return () # <<<<<<<<<<<<<< * it = concatv(top, it) * if key is None: */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_empty_tuple); __pyx_r = __pyx_empty_tuple; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1676 * return () * top = list(take(1, it)) * if len(top) == 0: # <<<<<<<<<<<<<< * return () * it = concatv(top, it) */ } /* "cytoolz/itertoolz.pyx":1678 * if len(top) == 0: * return () * it = concatv(top, it) # <<<<<<<<<<<<<< * if key is None: * return (max(it),) */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_concatv); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_top, __pyx_v_it}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1678, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_top, __pyx_v_it}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1678, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); } else #endif { __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL; } __Pyx_INCREF(__pyx_v_top); __Pyx_GIVEREF(__pyx_v_top); PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_top); __Pyx_INCREF(__pyx_v_it); __Pyx_GIVEREF(__pyx_v_it); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_it); __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_it, __pyx_t_5); __pyx_t_5 = 0; /* "cytoolz/itertoolz.pyx":1679 * return () * it = concatv(top, it) * if key is None: # <<<<<<<<<<<<<< * return (max(it),) * else: */ __pyx_t_2 = (__pyx_v_key == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "cytoolz/itertoolz.pyx":1680 * it = concatv(top, it) * if key is None: * return (max(it),) # <<<<<<<<<<<<<< * else: * return (max(it, key=key),) */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_v_it); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1679 * return () * it = concatv(top, it) * if key is None: # <<<<<<<<<<<<<< * return (max(it),) * else: */ } /* "cytoolz/itertoolz.pyx":1682 * return (max(it),) * else: * return (max(it, key=key),) # <<<<<<<<<<<<<< * * for item in it: */ /*else*/ { __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_it); __Pyx_GIVEREF(__pyx_v_it); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_it); __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, __pyx_v_key) < 0) __PYX_ERR(0, 1682, __pyx_L1_error) __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9); __pyx_t_9 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; } /* "cytoolz/itertoolz.pyx":1672 * key = getter(key) * * if k < 2: # <<<<<<<<<<<<<< * if k < 1: * return () */ } /* "cytoolz/itertoolz.pyx":1684 * return (max(it, key=key),) * * for item in it: # <<<<<<<<<<<<<< * if key is None: * PyList_Append(pq, (item, i)) */ if (likely(PyList_CheckExact(__pyx_v_it)) || PyTuple_CheckExact(__pyx_v_it)) { __pyx_t_5 = __pyx_v_it; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0; __pyx_t_10 = NULL; } else { __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_it); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1684, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_10)) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1684, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1684, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif } } else { __pyx_t_9 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_9)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 1684, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_9); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_9); __pyx_t_9 = 0; /* "cytoolz/itertoolz.pyx":1685 * * for item in it: * if key is None: # <<<<<<<<<<<<<< * PyList_Append(pq, (item, i)) * else: */ __pyx_t_3 = (__pyx_v_key == Py_None); __pyx_t_2 = (__pyx_t_3 != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":1686 * for item in it: * if key is None: * PyList_Append(pq, (item, i)) # <<<<<<<<<<<<<< * else: * PyList_Append(pq, (key(item), i, item)) */ __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1686, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_item); __Pyx_GIVEREF(__pyx_v_item); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_item); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_8 = PyList_Append(__pyx_v_pq, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1686, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1685 * * for item in it: * if key is None: # <<<<<<<<<<<<<< * PyList_Append(pq, (item, i)) * else: */ goto __pyx_L12; } /* "cytoolz/itertoolz.pyx":1688 * PyList_Append(pq, (item, i)) * else: * PyList_Append(pq, (key(item), i, item)) # <<<<<<<<<<<<<< * i -= 1 * if i == 0: */ /*else*/ { __Pyx_INCREF(__pyx_v_key); __pyx_t_9 = __pyx_v_key; __pyx_t_7 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_7, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_item); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1688, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9); __Pyx_INCREF(__pyx_v_item); __Pyx_GIVEREF(__pyx_v_item); PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_item); __pyx_t_1 = 0; __pyx_t_9 = 0; __pyx_t_8 = PyList_Append(__pyx_v_pq, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 1688, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_L12:; /* "cytoolz/itertoolz.pyx":1689 * else: * PyList_Append(pq, (key(item), i, item)) * i -= 1 # <<<<<<<<<<<<<< * if i == 0: * break */ __pyx_v_i = (__pyx_v_i - 1); /* "cytoolz/itertoolz.pyx":1690 * PyList_Append(pq, (key(item), i, item)) * i -= 1 * if i == 0: # <<<<<<<<<<<<<< * break * if i != 0: */ __pyx_t_2 = ((__pyx_v_i == 0) != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":1691 * i -= 1 * if i == 0: * break # <<<<<<<<<<<<<< * if i != 0: * pq.sort(reverse=True) */ goto __pyx_L11_break; /* "cytoolz/itertoolz.pyx":1690 * PyList_Append(pq, (key(item), i, item)) * i -= 1 * if i == 0: # <<<<<<<<<<<<<< * break * if i != 0: */ } /* "cytoolz/itertoolz.pyx":1684 * return (max(it, key=key),) * * for item in it: # <<<<<<<<<<<<<< * if key is None: * PyList_Append(pq, (item, i)) */ } __pyx_L11_break:; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "cytoolz/itertoolz.pyx":1692 * if i == 0: * break * if i != 0: # <<<<<<<<<<<<<< * pq.sort(reverse=True) * k = 0 if key is None else 2 */ __pyx_t_2 = ((__pyx_v_i != 0) != 0); if (__pyx_t_2) { /* "cytoolz/itertoolz.pyx":1693 * break * if i != 0: * pq.sort(reverse=True) # <<<<<<<<<<<<<< * k = 0 if key is None else 2 * return tuple([item[k] for item in pq]) */ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pq, __pyx_n_s_sort); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_reverse, Py_True) < 0) __PYX_ERR(0, 1693, __pyx_L1_error) __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1693, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "cytoolz/itertoolz.pyx":1694 * if i != 0: * pq.sort(reverse=True) * k = 0 if key is None else 2 # <<<<<<<<<<<<<< * return tuple([item[k] for item in pq]) * */ __pyx_t_2 = (__pyx_v_key == Py_None); if ((__pyx_t_2 != 0)) { __pyx_t_6 = 0; } else { __pyx_t_6 = 2; } __pyx_v_k = __pyx_t_6; /* "cytoolz/itertoolz.pyx":1695 * pq.sort(reverse=True) * k = 0 if key is None else 2 * return tuple([item[k] for item in pq]) # <<<<<<<<<<<<<< * * heapify(pq) */ __Pyx_XDECREF(__pyx_r); __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = __pyx_v_pq; __Pyx_INCREF(__pyx_t_7); __pyx_t_6 = 0; for (;;) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_7)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1695, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_7, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_item, __pyx_v_k, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 1695, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyList_AsTuple(((PyObject*)__pyx_t_9)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1692 * if i == 0: * break * if i != 0: # <<<<<<<<<<<<<< * pq.sort(reverse=True) * k = 0 if key is None else 2 */ } /* "cytoolz/itertoolz.pyx":1697 * return tuple([item[k] for item in pq]) * * heapify(pq) # <<<<<<<<<<<<<< * top = pq[0][0] * if key is None: */ __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_heapify); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_9, function); } } __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_5, __pyx_v_pq) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_pq); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "cytoolz/itertoolz.pyx":1698 * * heapify(pq) * top = pq[0][0] # <<<<<<<<<<<<<< * if key is None: * for item in it: */ __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_pq, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1698, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_top = __pyx_t_9; __pyx_t_9 = 0; /* "cytoolz/itertoolz.pyx":1699 * heapify(pq) * top = pq[0][0] * if key is None: # <<<<<<<<<<<<<< * for item in it: * if top < item: */ __pyx_t_2 = (__pyx_v_key == Py_None); __pyx_t_3 = (__pyx_t_2 != 0); if (__pyx_t_3) { /* "cytoolz/itertoolz.pyx":1700 * top = pq[0][0] * if key is None: * for item in it: # <<<<<<<<<<<<<< * if top < item: * _heapreplace(pq, (item, i)) */ if (likely(PyList_CheckExact(__pyx_v_it)) || PyTuple_CheckExact(__pyx_v_it)) { __pyx_t_9 = __pyx_v_it; __Pyx_INCREF(__pyx_t_9); __pyx_t_6 = 0; __pyx_t_10 = NULL; } else { __pyx_t_6 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_it); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1700, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_10)) { if (likely(PyList_CheckExact(__pyx_t_9))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_6); __Pyx_INCREF(__pyx_t_7); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1700, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_9, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_6); __Pyx_INCREF(__pyx_t_7); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1700, __pyx_L1_error) #else __pyx_t_7 = PySequence_ITEM(__pyx_t_9, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1700, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } } else { __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 1700, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_7); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7); __pyx_t_7 = 0; /* "cytoolz/itertoolz.pyx":1701 * if key is None: * for item in it: * if top < item: # <<<<<<<<<<<<<< * _heapreplace(pq, (item, i)) * top = pq[0][0] */ __pyx_t_7 = PyObject_RichCompare(__pyx_v_top, __pyx_v_item, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1701, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1701, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_3) { /* "cytoolz/itertoolz.pyx":1702 * for item in it: * if top < item: * _heapreplace(pq, (item, i)) # <<<<<<<<<<<<<< * top = pq[0][0] * i -= 1 */ __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_item); __Pyx_GIVEREF(__pyx_v_item); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_item); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __pyx_t_5 = 0; __Pyx_INCREF(__pyx_v__heapreplace); __pyx_t_5 = __pyx_v__heapreplace; __pyx_t_11 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_11)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_pq, __pyx_t_1}; __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1702, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_pq, __pyx_t_1}; __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1702, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { __pyx_t_12 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_11) { __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL; } __Pyx_INCREF(__pyx_v_pq); __Pyx_GIVEREF(__pyx_v_pq); PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_8, __pyx_v_pq); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_8, __pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "cytoolz/itertoolz.pyx":1703 * if top < item: * _heapreplace(pq, (item, i)) * top = pq[0][0] # <<<<<<<<<<<<<< * i -= 1 * else: */ __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_pq, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_top, __pyx_t_5); __pyx_t_5 = 0; /* "cytoolz/itertoolz.pyx":1704 * _heapreplace(pq, (item, i)) * top = pq[0][0] * i -= 1 # <<<<<<<<<<<<<< * else: * for item in it: */ __pyx_v_i = (__pyx_v_i - 1); /* "cytoolz/itertoolz.pyx":1701 * if key is None: * for item in it: * if top < item: # <<<<<<<<<<<<<< * _heapreplace(pq, (item, i)) * top = pq[0][0] */ } /* "cytoolz/itertoolz.pyx":1700 * top = pq[0][0] * if key is None: * for item in it: # <<<<<<<<<<<<<< * if top < item: * _heapreplace(pq, (item, i)) */ } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; /* "cytoolz/itertoolz.pyx":1699 * heapify(pq) * top = pq[0][0] * if key is None: # <<<<<<<<<<<<<< * for item in it: * if top < item: */ goto __pyx_L17; } /* "cytoolz/itertoolz.pyx":1706 * i -= 1 * else: * for item in it: # <<<<<<<<<<<<<< * val = key(item) * if top < val: */ /*else*/ { if (likely(PyList_CheckExact(__pyx_v_it)) || PyTuple_CheckExact(__pyx_v_it)) { __pyx_t_9 = __pyx_v_it; __Pyx_INCREF(__pyx_t_9); __pyx_t_6 = 0; __pyx_t_10 = NULL; } else { __pyx_t_6 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_it); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1706, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_10)) { if (likely(PyList_CheckExact(__pyx_t_9))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1706, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_9, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1706, __pyx_L1_error) #else __pyx_t_5 = PySequence_ITEM(__pyx_t_9, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1706, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { __pyx_t_5 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 1706, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5); __pyx_t_5 = 0; /* "cytoolz/itertoolz.pyx":1707 * else: * for item in it: * val = key(item) # <<<<<<<<<<<<<< * if top < val: * _heapreplace(pq, (val, i, item)) */ __Pyx_INCREF(__pyx_v_key); __pyx_t_7 = __pyx_v_key; __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_12)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_5 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_12, __pyx_v_item) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_item); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1707, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5); __pyx_t_5 = 0; /* "cytoolz/itertoolz.pyx":1708 * for item in it: * val = key(item) * if top < val: # <<<<<<<<<<<<<< * _heapreplace(pq, (val, i, item)) * top = pq[0][0] */ __pyx_t_5 = PyObject_RichCompare(__pyx_v_top, __pyx_v_val, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1708, __pyx_L1_error) __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1708, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_3) { /* "cytoolz/itertoolz.pyx":1709 * val = key(item) * if top < val: * _heapreplace(pq, (val, i, item)) # <<<<<<<<<<<<<< * top = pq[0][0] * i -= 1 */ __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_val); __Pyx_GIVEREF(__pyx_v_val); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_val); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_7); __Pyx_INCREF(__pyx_v_item); __Pyx_GIVEREF(__pyx_v_item); PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_v_item); __pyx_t_7 = 0; __Pyx_INCREF(__pyx_v__heapreplace); __pyx_t_7 = __pyx_v__heapreplace; __pyx_t_1 = NULL; __pyx_t_8 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) { __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_1)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_8 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_pq, __pyx_t_12}; __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1709, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_v_pq, __pyx_t_12}; __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1709, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else #endif { __pyx_t_11 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_INCREF(__pyx_v_pq); __Pyx_GIVEREF(__pyx_v_pq); PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_8, __pyx_v_pq); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_8, __pyx_t_12); __pyx_t_12 = 0; __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1709, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "cytoolz/itertoolz.pyx":1710 * if top < val: * _heapreplace(pq, (val, i, item)) * top = pq[0][0] # <<<<<<<<<<<<<< * i -= 1 * */ __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_pq, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_top, __pyx_t_7); __pyx_t_7 = 0; /* "cytoolz/itertoolz.pyx":1711 * _heapreplace(pq, (val, i, item)) * top = pq[0][0] * i -= 1 # <<<<<<<<<<<<<< * * pq.sort(reverse=True) */ __pyx_v_i = (__pyx_v_i - 1); /* "cytoolz/itertoolz.pyx":1708 * for item in it: * val = key(item) * if top < val: # <<<<<<<<<<<<<< * _heapreplace(pq, (val, i, item)) * top = pq[0][0] */ } /* "cytoolz/itertoolz.pyx":1706 * i -= 1 * else: * for item in it: # <<<<<<<<<<<<<< * val = key(item) * if top < val: */ } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_L17:; /* "cytoolz/itertoolz.pyx":1713 * i -= 1 * * pq.sort(reverse=True) # <<<<<<<<<<<<<< * k = 0 if key is None else 2 * return tuple([item[k] for item in pq]) */ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_pq, __pyx_n_s_sort); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_reverse, Py_True) < 0) __PYX_ERR(0, 1713, __pyx_L1_error) __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "cytoolz/itertoolz.pyx":1714 * * pq.sort(reverse=True) * k = 0 if key is None else 2 # <<<<<<<<<<<<<< * return tuple([item[k] for item in pq]) * */ __pyx_t_3 = (__pyx_v_key == Py_None); if ((__pyx_t_3 != 0)) { __pyx_t_6 = 0; } else { __pyx_t_6 = 2; } __pyx_v_k = __pyx_t_6; /* "cytoolz/itertoolz.pyx":1715 * pq.sort(reverse=True) * k = 0 if key is None else 2 * return tuple([item[k] for item in pq]) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __pyx_v_pq; __Pyx_INCREF(__pyx_t_7); __pyx_t_6 = 0; for (;;) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_7)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __pyx_t_9 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1715, __pyx_L1_error) #else __pyx_t_9 = PySequence_ITEM(__pyx_t_7, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_item, __pyx_v_k, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 1715, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyList_AsTuple(((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1646 * * * cpdef object topk(Py_ssize_t k, object seq, object key=None): # <<<<<<<<<<<<<< * """ * Find the k largest elements of a sequence */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("cytoolz.itertoolz.topk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_item); __Pyx_XDECREF(__pyx_v_val); __Pyx_XDECREF(__pyx_v_top); __Pyx_XDECREF(__pyx_v_it); __Pyx_XDECREF(__pyx_v__heapreplace); __Pyx_XDECREF(__pyx_v_pq); __Pyx_XDECREF(__pyx_v_key); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_57topk(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_56topk[] = "topk(Py_ssize_t k, seq, key=None)\n\n Find the k largest elements of a sequence\n\n Operates lazily in ``n*log(k)`` time\n\n >>> topk(2, [1, 100, 10, 1000])\n (1000, 100)\n\n Use a key function to change sorted order\n\n >>> topk(2, ['Alice', 'Bob', 'Charlie', 'Dan'], key=len)\n ('Charlie', 'Alice')\n\n See also:\n heapq.nlargest\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_57topk = {"topk", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9itertoolz_57topk, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9itertoolz_56topk}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_57topk(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { Py_ssize_t __pyx_v_k; PyObject *__pyx_v_seq = 0; PyObject *__pyx_v_key = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("topk (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_seq,&__pyx_n_s_key,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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("topk", 0, 2, 3, 1); __PYX_ERR(0, 1646, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "topk") < 0)) __PYX_ERR(0, 1646, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; 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_k = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_k == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1646, __pyx_L3_error) __pyx_v_seq = values[1]; __pyx_v_key = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("topk", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1646, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.topk", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_56topk(__pyx_self, __pyx_v_k, __pyx_v_seq, __pyx_v_key); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_56topk(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_k, PyObject *__pyx_v_seq, PyObject *__pyx_v_key) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; struct __pyx_opt_args_7cytoolz_9itertoolz_topk __pyx_t_2; __Pyx_RefNannySetupContext("topk", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_2.__pyx_n = 1; __pyx_t_2.key = __pyx_v_key; __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_topk(__pyx_v_k, __pyx_v_seq, 0, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.topk", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1718 * * * cpdef object peek(object seq): # <<<<<<<<<<<<<< * """ * Retrieve the next element of a sequence */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_59peek(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_peek(PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_v_iterator = NULL; PyObject *__pyx_v_item = 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; __Pyx_RefNannySetupContext("peek", 0); /* "cytoolz/itertoolz.pyx":1732 * [0, 1, 2, 3, 4] * """ * iterator = iter(seq) # <<<<<<<<<<<<<< * item = next(iterator) * return item, chain((item,), iterator) */ __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_iterator = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1733 * """ * iterator = iter(seq) * item = next(iterator) # <<<<<<<<<<<<<< * return item, chain((item,), iterator) * */ __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_iterator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_item = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1734 * iterator = iter(seq) * item = next(iterator) * return item, chain((item,), iterator) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_chain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_item); __Pyx_GIVEREF(__pyx_v_item); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_item); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_iterator}; __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1734, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_iterator}; __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1734, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_v_iterator); __Pyx_GIVEREF(__pyx_v_iterator); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_iterator); __pyx_t_3 = 0; __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1734, __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 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_item); __Pyx_GIVEREF(__pyx_v_item); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_item); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1718 * * * cpdef object peek(object seq): # <<<<<<<<<<<<<< * """ * Retrieve the next element of a sequence */ /* 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_6); __Pyx_AddTraceback("cytoolz.itertoolz.peek", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_iterator); __Pyx_XDECREF(__pyx_v_item); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_59peek(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_58peek[] = "peek(seq)\n\n Retrieve the next element of a sequence\n\n Returns the first element and an iterable equivalent to the original\n sequence, still having the element retrieved.\n\n >>> seq = [0, 1, 2, 3, 4]\n >>> first, seq = peek(seq)\n >>> first\n 0\n >>> list(seq)\n [0, 1, 2, 3, 4]\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_59peek = {"peek", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_59peek, METH_O, __pyx_doc_7cytoolz_9itertoolz_58peek}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_59peek(PyObject *__pyx_self, PyObject *__pyx_v_seq) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("peek (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_58peek(__pyx_self, ((PyObject *)__pyx_v_seq)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_58peek(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("peek", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_peek(__pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.peek", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1737 * * * cpdef object peekn(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * Retrieve the next n elements of a sequence */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_61peekn(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_9itertoolz_peekn(Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) { PyObject *__pyx_v_iterator = NULL; PyObject *__pyx_v_peeked = 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; __Pyx_RefNannySetupContext("peekn", 0); /* "cytoolz/itertoolz.pyx":1751 * [0, 1, 2, 3, 4] * """ * iterator = iter(seq) # <<<<<<<<<<<<<< * peeked = tuple(take(n, iterator)) * return peeked, chain(iter(peeked), iterator) */ __pyx_t_1 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_iterator = __pyx_t_1; __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":1752 * """ * iterator = iter(seq) * peeked = tuple(take(n, iterator)) # <<<<<<<<<<<<<< * return peeked, chain(iter(peeked), iterator) * */ __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_take(__pyx_v_n, __pyx_v_iterator, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1752, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_peeked = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1753 * iterator = iter(seq) * peeked = tuple(take(n, iterator)) * return peeked, chain(iter(peeked), iterator) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_chain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_GetIter(__pyx_v_peeked); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_iterator}; __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1753, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_iterator}; __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1753, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else #endif { __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL; } __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_v_iterator); __Pyx_GIVEREF(__pyx_v_iterator); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_iterator); __pyx_t_3 = 0; __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1753, __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_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_peeked); __Pyx_GIVEREF(__pyx_v_peeked); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_peeked); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; /* "cytoolz/itertoolz.pyx":1737 * * * cpdef object peekn(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * Retrieve the next n elements of a sequence */ /* 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_6); __Pyx_AddTraceback("cytoolz.itertoolz.peekn", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v_iterator); __Pyx_XDECREF(__pyx_v_peeked); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_61peekn(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_60peekn[] = "peekn(Py_ssize_t n, seq)\n\n Retrieve the next n elements of a sequence\n\n Returns a tuple of the first n elements and an iterable equivalent\n to the original, still having the elements retrieved.\n\n >>> seq = [0, 1, 2, 3, 4]\n >>> first_two, seq = peekn(2, seq)\n >>> first_two\n (0, 1)\n >>> list(seq)\n [0, 1, 2, 3, 4]\n "; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_61peekn = {"peekn", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9itertoolz_61peekn, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9itertoolz_60peekn}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_61peekn(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { Py_ssize_t __pyx_v_n; PyObject *__pyx_v_seq = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("peekn (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_seq,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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("peekn", 1, 2, 2, 1); __PYX_ERR(0, 1737, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "peekn") < 0)) __PYX_ERR(0, 1737, __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_n = __Pyx_PyIndex_AsSsize_t(values[0]); if (unlikely((__pyx_v_n == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1737, __pyx_L3_error) __pyx_v_seq = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("peekn", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1737, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.peekn", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_60peekn(__pyx_self, __pyx_v_n, __pyx_v_seq); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_60peekn(CYTHON_UNUSED PyObject *__pyx_self, Py_ssize_t __pyx_v_n, PyObject *__pyx_v_seq) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("peekn", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_9itertoolz_peekn(__pyx_v_n, __pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.itertoolz.peekn", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1790 * [7, 9, 19, 25, 30, 32, 34, 48, 59, 60, 81, 98] * """ * def __cinit__(self, object prob, object seq, random_state=None): # <<<<<<<<<<<<<< * float(prob) * self.prob = prob */ /* Python wrapper */ static int __pyx_pw_7cytoolz_9itertoolz_13random_sample_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_9itertoolz_13random_sample_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_prob = 0; PyObject *__pyx_v_seq = 0; PyObject *__pyx_v_random_state = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_prob,&__pyx_n_s_seq,&__pyx_n_s_random_state,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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_prob)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(0, 1790, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_random_state); 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_ERR(0, 1790, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); CYTHON_FALLTHROUGH; 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_prob = values[0]; __pyx_v_seq = values[1]; __pyx_v_random_state = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1790, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.random_sample.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13random_sample___cinit__(((struct __pyx_obj_7cytoolz_9itertoolz_random_sample *)__pyx_v_self), __pyx_v_prob, __pyx_v_seq, __pyx_v_random_state); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_9itertoolz_13random_sample___cinit__(struct __pyx_obj_7cytoolz_9itertoolz_random_sample *__pyx_v_self, PyObject *__pyx_v_prob, PyObject *__pyx_v_seq, PyObject *__pyx_v_random_state) { int __pyx_r; __Pyx_RefNannyDeclarations double __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; __Pyx_RefNannySetupContext("__cinit__", 0); __Pyx_INCREF(__pyx_v_random_state); /* "cytoolz/itertoolz.pyx":1791 * """ * def __cinit__(self, object prob, object seq, random_state=None): * float(prob) # <<<<<<<<<<<<<< * self.prob = prob * self.iter_seq = iter(seq) */ __pyx_t_1 = __Pyx_PyObject_AsDouble(__pyx_v_prob); if (unlikely(__pyx_t_1 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1791, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":1792 * def __cinit__(self, object prob, object seq, random_state=None): * float(prob) * self.prob = prob # <<<<<<<<<<<<<< * self.iter_seq = iter(seq) * if not hasattr(random_state, 'random'): */ __Pyx_INCREF(__pyx_v_prob); __Pyx_GIVEREF(__pyx_v_prob); __Pyx_GOTREF(__pyx_v_self->prob); __Pyx_DECREF(__pyx_v_self->prob); __pyx_v_self->prob = __pyx_v_prob; /* "cytoolz/itertoolz.pyx":1793 * float(prob) * self.prob = prob * self.iter_seq = iter(seq) # <<<<<<<<<<<<<< * if not hasattr(random_state, 'random'): * random_state = Random(random_state) */ __pyx_t_2 = PyObject_GetIter(__pyx_v_seq); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->iter_seq); __Pyx_DECREF(__pyx_v_self->iter_seq); __pyx_v_self->iter_seq = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1794 * self.prob = prob * self.iter_seq = iter(seq) * if not hasattr(random_state, 'random'): # <<<<<<<<<<<<<< * random_state = Random(random_state) * self.random_func = random_state.random */ __pyx_t_3 = __Pyx_HasAttr(__pyx_v_random_state, __pyx_n_s_random); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1794, __pyx_L1_error) __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0); if (__pyx_t_4) { /* "cytoolz/itertoolz.pyx":1795 * self.iter_seq = iter(seq) * if not hasattr(random_state, 'random'): * random_state = Random(random_state) # <<<<<<<<<<<<<< * self.random_func = random_state.random * */ __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Random); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_random_state) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_random_state); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1795, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF_SET(__pyx_v_random_state, __pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1794 * self.prob = prob * self.iter_seq = iter(seq) * if not hasattr(random_state, 'random'): # <<<<<<<<<<<<<< * random_state = Random(random_state) * self.random_func = random_state.random */ } /* "cytoolz/itertoolz.pyx":1796 * if not hasattr(random_state, 'random'): * random_state = Random(random_state) * self.random_func = random_state.random # <<<<<<<<<<<<<< * * def __iter__(self): */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_random_state, __pyx_n_s_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __Pyx_GOTREF(__pyx_v_self->random_func); __Pyx_DECREF(__pyx_v_self->random_func); __pyx_v_self->random_func = __pyx_t_2; __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1790 * [7, 9, 19, 25, 30, 32, 34, 48, 59, 60, 81, 98] * """ * def __cinit__(self, object prob, object seq, random_state=None): # <<<<<<<<<<<<<< * float(prob) * self.prob = prob */ /* 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_6); __Pyx_AddTraceback("cytoolz.itertoolz.random_sample.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_XDECREF(__pyx_v_random_state); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1798 * self.random_func = random_state.random * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13random_sample_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13random_sample_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13random_sample_2__iter__(((struct __pyx_obj_7cytoolz_9itertoolz_random_sample *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_13random_sample_2__iter__(struct __pyx_obj_7cytoolz_9itertoolz_random_sample *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* "cytoolz/itertoolz.pyx":1799 * * 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; /* "cytoolz/itertoolz.pyx":1798 * self.random_func = random_state.random * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/itertoolz.pyx":1801 * return self * * def __next__(self): # <<<<<<<<<<<<<< * while True: * if self.random_func() < self.prob: */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13random_sample_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13random_sample_5__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13random_sample_4__next__(((struct __pyx_obj_7cytoolz_9itertoolz_random_sample *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_13random_sample_4__next__(struct __pyx_obj_7cytoolz_9itertoolz_random_sample *__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; __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/itertoolz.pyx":1802 * * def __next__(self): * while True: # <<<<<<<<<<<<<< * if self.random_func() < self.prob: * return next(self.iter_seq) */ while (1) { /* "cytoolz/itertoolz.pyx":1803 * def __next__(self): * while True: * if self.random_func() < self.prob: # <<<<<<<<<<<<<< * return next(self.iter_seq) * next(self.iter_seq) */ __Pyx_INCREF(__pyx_v_self->random_func); __pyx_t_2 = __pyx_v_self->random_func; __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1803, __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_v_self->prob, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1803, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1803, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { /* "cytoolz/itertoolz.pyx":1804 * while True: * if self.random_func() < self.prob: * return next(self.iter_seq) # <<<<<<<<<<<<<< * next(self.iter_seq) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = __pyx_v_self->iter_seq; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = __Pyx_PyIter_Next(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1804, __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; /* "cytoolz/itertoolz.pyx":1803 * def __next__(self): * while True: * if self.random_func() < self.prob: # <<<<<<<<<<<<<< * return next(self.iter_seq) * next(self.iter_seq) */ } /* "cytoolz/itertoolz.pyx":1805 * if self.random_func() < self.prob: * return next(self.iter_seq) * next(self.iter_seq) # <<<<<<<<<<<<<< */ __pyx_t_1 = __pyx_v_self->iter_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1805, __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; } /* "cytoolz/itertoolz.pyx":1801 * return self * * def __next__(self): # <<<<<<<<<<<<<< * while True: * if self.random_func() < self.prob: */ /* 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("cytoolz.itertoolz.random_sample.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13random_sample_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_13random_sample_6__reduce_cython__[] = "random_sample.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_13random_sample_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_13random_sample_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_13random_sample_6__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_13random_sample_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13random_sample_6__reduce_cython__(((struct __pyx_obj_7cytoolz_9itertoolz_random_sample *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_13random_sample_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_random_sample *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __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_ERR(1, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz.random_sample.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_13random_sample_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_13random_sample_8__setstate_cython__[] = "random_sample.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_13random_sample_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_13random_sample_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_13random_sample_8__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_13random_sample_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_9itertoolz_13random_sample_8__setstate_cython__(((struct __pyx_obj_7cytoolz_9itertoolz_random_sample *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_13random_sample_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_9itertoolz_random_sample *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __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_ERR(1, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.itertoolz.random_sample.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __pyx_unpickle__getter_null(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_9itertoolz_63__pyx_unpickle__getter_null(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_9itertoolz_62__pyx_unpickle__getter_null[] = "__pyx_unpickle__getter_null(__pyx_type, long __pyx_checksum, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_9itertoolz_63__pyx_unpickle__getter_null = {"__pyx_unpickle__getter_null", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_9itertoolz_63__pyx_unpickle__getter_null, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_9itertoolz_62__pyx_unpickle__getter_null}; static PyObject *__pyx_pw_7cytoolz_9itertoolz_63__pyx_unpickle__getter_null(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v___pyx_type = 0; long __pyx_v___pyx_checksum; PyObject *__pyx_v___pyx_state = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__pyx_unpickle__getter_null (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,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); CYTHON_FALLTHROUGH; case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__getter_null", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__getter_null", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle__getter_null") < 0)) __PYX_ERR(1, 1, __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___pyx_type = values[0]; __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error) __pyx_v___pyx_state = values[2]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__pyx_unpickle__getter_null", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.itertoolz.__pyx_unpickle__getter_null", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_9itertoolz_62__pyx_unpickle__getter_null(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_9itertoolz_62__pyx_unpickle__getter_null(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; 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_t_6; __Pyx_RefNannySetupContext("__pyx_unpickle__getter_null", 0); /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum != 0xd41d8cd: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) */ __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xd41d8cd) != 0); if (__pyx_t_1) { /* "(tree fragment)":5 * cdef object __pyx_result * if __pyx_checksum != 0xd41d8cd: * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<< * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) * __pyx_result = _getter_null.__new__(__pyx_type) */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_PickleError); __Pyx_GIVEREF(__pyx_n_s_PickleError); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError); __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __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_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_t_2); __pyx_v___pyx_PickleError = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":6 * if __pyx_checksum != 0xd41d8cd: * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) # <<<<<<<<<<<<<< * __pyx_result = _getter_null.__new__(__pyx_type) * if __pyx_state is not None: */ __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xd4, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_INCREF(__pyx_v___pyx_PickleError); __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __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_ERR(1, 6, __pyx_L1_error) /* "(tree fragment)":4 * cdef object __pyx_PickleError * cdef object __pyx_result * if __pyx_checksum != 0xd41d8cd: # <<<<<<<<<<<<<< * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) */ } /* "(tree fragment)":7 * from pickle import PickleError as __pyx_PickleError * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) * __pyx_result = _getter_null.__new__(__pyx_type) # <<<<<<<<<<<<<< * if __pyx_state is not None: * __pyx_unpickle__getter_null__set_state(<_getter_null> __pyx_result, __pyx_state) */ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7cytoolz_9itertoolz__getter_null), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v___pyx_result = __pyx_t_3; __pyx_t_3 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) * __pyx_result = _getter_null.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle__getter_null__set_state(<_getter_null> __pyx_result, __pyx_state) * return __pyx_result */ __pyx_t_1 = (__pyx_v___pyx_state != Py_None); __pyx_t_6 = (__pyx_t_1 != 0); if (__pyx_t_6) { /* "(tree fragment)":9 * __pyx_result = _getter_null.__new__(__pyx_type) * if __pyx_state is not None: * __pyx_unpickle__getter_null__set_state(<_getter_null> __pyx_result, __pyx_state) # <<<<<<<<<<<<<< * return __pyx_result * cdef __pyx_unpickle__getter_null__set_state(_getter_null __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error) __pyx_t_3 = __pyx_f_7cytoolz_9itertoolz___pyx_unpickle__getter_null__set_state(((struct __pyx_obj_7cytoolz_9itertoolz__getter_null *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "(tree fragment)":8 * raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum) * __pyx_result = _getter_null.__new__(__pyx_type) * if __pyx_state is not None: # <<<<<<<<<<<<<< * __pyx_unpickle__getter_null__set_state(<_getter_null> __pyx_result, __pyx_state) * return __pyx_result */ } /* "(tree fragment)":10 * if __pyx_state is not None: * __pyx_unpickle__getter_null__set_state(<_getter_null> __pyx_result, __pyx_state) * return __pyx_result # <<<<<<<<<<<<<< * cdef __pyx_unpickle__getter_null__set_state(_getter_null __pyx_result, tuple __pyx_state): * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v___pyx_result); __pyx_r = __pyx_v___pyx_result; goto __pyx_L0; /* "(tree fragment)":1 * def __pyx_unpickle__getter_null(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_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("cytoolz.itertoolz.__pyx_unpickle__getter_null", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); __Pyx_XDECREF(__pyx_v___pyx_result); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":11 * __pyx_unpickle__getter_null__set_state(<_getter_null> __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle__getter_null__set_state(_getter_null __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[0]) */ static PyObject *__pyx_f_7cytoolz_9itertoolz___pyx_unpickle__getter_null__set_state(struct __pyx_obj_7cytoolz_9itertoolz__getter_null *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_t_1; 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; PyObject *__pyx_t_8 = NULL; __Pyx_RefNannySetupContext("__pyx_unpickle__getter_null__set_state", 0); /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle__getter_null__set_state(_getter_null __pyx_result, tuple __pyx_state): * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[0]) */ if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); __PYX_ERR(1, 12, __pyx_L1_error) } __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 12, __pyx_L1_error) __pyx_t_3 = ((__pyx_t_2 > 0) != 0); if (__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error) __pyx_t_4 = (__pyx_t_3 != 0); __pyx_t_1 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_1) { /* "(tree fragment)":13 * cdef __pyx_unpickle__getter_null__set_state(_getter_null __pyx_result, tuple __pyx_state): * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[0]) # <<<<<<<<<<<<<< */ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(__pyx_v___pyx_state == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); __PYX_ERR(1, 13, __pyx_L1_error) } __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); } } __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "(tree fragment)":12 * return __pyx_result * cdef __pyx_unpickle__getter_null__set_state(_getter_null __pyx_result, tuple __pyx_state): * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<< * __pyx_result.__dict__.update(__pyx_state[0]) */ } /* "(tree fragment)":11 * __pyx_unpickle__getter_null__set_state(<_getter_null> __pyx_result, __pyx_state) * return __pyx_result * cdef __pyx_unpickle__getter_null__set_state(_getter_null __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<< * if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'): * __pyx_result.__dict__.update(__pyx_state[0]) */ /* 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); __Pyx_AddTraceback("cytoolz.itertoolz.__pyx_unpickle__getter_null__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_remove(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz_remove *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_7cytoolz_9itertoolz_remove *)o); p->predicate = Py_None; Py_INCREF(Py_None); p->iter_seq = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9itertoolz_6remove_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9itertoolz_remove(PyObject *o) { struct __pyx_obj_7cytoolz_9itertoolz_remove *p = (struct __pyx_obj_7cytoolz_9itertoolz_remove *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->predicate); Py_CLEAR(p->iter_seq); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9itertoolz_remove(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9itertoolz_remove *p = (struct __pyx_obj_7cytoolz_9itertoolz_remove *)o; if (p->predicate) { e = (*v)(p->predicate, a); if (e) return e; } if (p->iter_seq) { e = (*v)(p->iter_seq, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9itertoolz_remove(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9itertoolz_remove *p = (struct __pyx_obj_7cytoolz_9itertoolz_remove *)o; tmp = ((PyObject*)p->predicate); p->predicate = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->iter_seq); p->iter_seq = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_6remove_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_6remove_5__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz_remove[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_6remove_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_6remove_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_6remove_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_6remove_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_6remove_8__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz_remove = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz.remove", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz_remove), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz_remove, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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*/ " remove(predicate, seq)\n\n Return those items of sequence for which predicate(item) is False\n\n >>> def iseven(x):\n ... return x % 2 == 0\n >>> list(remove(iseven, [1, 2, 3, 4]))\n [1, 3]\n ", /*tp_doc*/ __pyx_tp_traverse_7cytoolz_9itertoolz_remove, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz_remove, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_7cytoolz_9itertoolz_6remove_3__iter__, /*tp_iter*/ __pyx_pw_7cytoolz_9itertoolz_6remove_5__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz_remove, /*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_7cytoolz_9itertoolz_remove, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_accumulate(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz_accumulate *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_7cytoolz_9itertoolz_accumulate *)o); p->binop = Py_None; Py_INCREF(Py_None); p->iter_seq = Py_None; Py_INCREF(Py_None); p->result = Py_None; Py_INCREF(Py_None); p->initial = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9itertoolz_10accumulate_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9itertoolz_accumulate(PyObject *o) { struct __pyx_obj_7cytoolz_9itertoolz_accumulate *p = (struct __pyx_obj_7cytoolz_9itertoolz_accumulate *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->binop); Py_CLEAR(p->iter_seq); Py_CLEAR(p->result); Py_CLEAR(p->initial); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9itertoolz_accumulate(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9itertoolz_accumulate *p = (struct __pyx_obj_7cytoolz_9itertoolz_accumulate *)o; if (p->binop) { e = (*v)(p->binop, a); if (e) return e; } if (p->iter_seq) { e = (*v)(p->iter_seq, a); if (e) return e; } if (p->result) { e = (*v)(p->result, a); if (e) return e; } if (p->initial) { e = (*v)(p->initial, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9itertoolz_accumulate(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9itertoolz_accumulate *p = (struct __pyx_obj_7cytoolz_9itertoolz_accumulate *)o; tmp = ((PyObject*)p->binop); p->binop = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->iter_seq); p->iter_seq = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->result); p->result = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->initial); p->initial = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_10accumulate_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_10accumulate_5__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz_accumulate[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_10accumulate_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_10accumulate_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_10accumulate_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_10accumulate_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_10accumulate_8__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz_accumulate = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz.accumulate", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz_accumulate), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz_accumulate, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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*/ " accumulate(binop, seq, initial='__no__default__')\n\n Repeatedly apply binary function to a sequence, accumulating results\n\n >>> from operator import add, mul\n >>> list(accumulate(add, [1, 2, 3, 4, 5]))\n [1, 3, 6, 10, 15]\n >>> list(accumulate(mul, [1, 2, 3, 4, 5]))\n [1, 2, 6, 24, 120]\n\n Accumulate is similar to ``reduce`` and is good for making functions like\n cumulative sum:\n\n >>> from functools import partial, reduce\n >>> sum = partial(reduce, add)\n >>> cumsum = partial(accumulate, add)\n\n Accumulate also takes an optional argument that will be used as the first\n value. This is similar to reduce.\n\n >>> list(accumulate(add, [1, 2, 3], -1))\n [-1, 0, 2, 5]\n >>> list(accumulate(add, [], 1))\n [1]\n\n See Also:\n itertools.accumulate : In standard itertools for Python 3.2+\n ", /*tp_doc*/ __pyx_tp_traverse_7cytoolz_9itertoolz_accumulate, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz_accumulate, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_7cytoolz_9itertoolz_10accumulate_3__iter__, /*tp_iter*/ __pyx_pw_7cytoolz_9itertoolz_10accumulate_5__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz_accumulate, /*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_7cytoolz_9itertoolz_accumulate, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__merge_sorted(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *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_7cytoolz_9itertoolz__merge_sorted *)o); p->seq1 = Py_None; Py_INCREF(Py_None); p->seq2 = Py_None; Py_INCREF(Py_None); p->val1 = Py_None; Py_INCREF(Py_None); p->val2 = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9itertoolz__merge_sorted(PyObject *o) { struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *p = (struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->seq1); Py_CLEAR(p->seq2); Py_CLEAR(p->val1); Py_CLEAR(p->val2); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9itertoolz__merge_sorted(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *p = (struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *)o; if (p->seq1) { e = (*v)(p->seq1, a); if (e) return e; } if (p->seq2) { e = (*v)(p->seq2, a); if (e) return e; } if (p->val1) { e = (*v)(p->val1, a); if (e) return e; } if (p->val2) { e = (*v)(p->val2, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9itertoolz__merge_sorted(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *p = (struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted *)o; tmp = ((PyObject*)p->seq1); p->seq1 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->seq2); p->seq2 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->val1); p->val1 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->val2); p->val2 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_5__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__merge_sorted[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_13_merge_sorted_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_13_merge_sorted_8__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__merge_sorted = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._merge_sorted", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__merge_sorted, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__merge_sorted, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__merge_sorted, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_3__iter__, /*tp_iter*/ __pyx_pw_7cytoolz_9itertoolz_13_merge_sorted_5__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz__merge_sorted, /*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_7cytoolz_9itertoolz__merge_sorted, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__merge_sorted_key(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *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_7cytoolz_9itertoolz__merge_sorted_key *)o); p->seq1 = Py_None; Py_INCREF(Py_None); p->seq2 = Py_None; Py_INCREF(Py_None); p->val1 = Py_None; Py_INCREF(Py_None); p->val2 = Py_None; Py_INCREF(Py_None); p->key = Py_None; Py_INCREF(Py_None); p->key1 = Py_None; Py_INCREF(Py_None); p->key2 = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9itertoolz__merge_sorted_key(PyObject *o) { struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *p = (struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->seq1); Py_CLEAR(p->seq2); Py_CLEAR(p->val1); Py_CLEAR(p->val2); Py_CLEAR(p->key); Py_CLEAR(p->key1); Py_CLEAR(p->key2); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9itertoolz__merge_sorted_key(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *p = (struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *)o; if (p->seq1) { e = (*v)(p->seq1, a); if (e) return e; } if (p->seq2) { e = (*v)(p->seq2, a); if (e) return e; } if (p->val1) { e = (*v)(p->val1, a); if (e) return e; } if (p->val2) { e = (*v)(p->val2, a); if (e) return e; } if (p->key) { e = (*v)(p->key, a); if (e) return e; } if (p->key1) { e = (*v)(p->key1, a); if (e) return e; } if (p->key2) { e = (*v)(p->key2, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9itertoolz__merge_sorted_key(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *p = (struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key *)o; tmp = ((PyObject*)p->seq1); p->seq1 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->seq2); p->seq2 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->val1); p->val1 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->val2); p->val2 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->key); p->key = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->key1); p->key1 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->key2); p->key2 = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_5__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__merge_sorted_key[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_17_merge_sorted_key_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_17_merge_sorted_key_8__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__merge_sorted_key = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._merge_sorted_key", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__merge_sorted_key, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__merge_sorted_key, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__merge_sorted_key, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_3__iter__, /*tp_iter*/ __pyx_pw_7cytoolz_9itertoolz_17_merge_sorted_key_5__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz__merge_sorted_key, /*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_7cytoolz_9itertoolz__merge_sorted_key, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_interleave(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz_interleave *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_7cytoolz_9itertoolz_interleave *)o); p->iters = ((PyObject*)Py_None); Py_INCREF(Py_None); p->newiters = ((PyObject*)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9itertoolz_10interleave_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9itertoolz_interleave(PyObject *o) { struct __pyx_obj_7cytoolz_9itertoolz_interleave *p = (struct __pyx_obj_7cytoolz_9itertoolz_interleave *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->iters); Py_CLEAR(p->newiters); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9itertoolz_interleave(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9itertoolz_interleave *p = (struct __pyx_obj_7cytoolz_9itertoolz_interleave *)o; if (p->iters) { e = (*v)(p->iters, a); if (e) return e; } if (p->newiters) { e = (*v)(p->newiters, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9itertoolz_interleave(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9itertoolz_interleave *p = (struct __pyx_obj_7cytoolz_9itertoolz_interleave *)o; tmp = ((PyObject*)p->iters); p->iters = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->newiters); p->newiters = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_10interleave_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_10interleave_5__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz_interleave[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_10interleave_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_10interleave_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_10interleave_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_10interleave_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_10interleave_8__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz_interleave = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz.interleave", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz_interleave), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz_interleave, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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*/ " interleave(seqs)\n\n Interleave a sequence of sequences\n\n >>> list(interleave([[1, 2], [3, 4]]))\n [1, 3, 2, 4]\n\n >>> ''.join(interleave(('ABC', 'XY')))\n 'AXBYC'\n\n Both the individual sequences and the sequence of sequences may be infinite\n\n Returns a lazy iterator\n ", /*tp_doc*/ __pyx_tp_traverse_7cytoolz_9itertoolz_interleave, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz_interleave, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_7cytoolz_9itertoolz_10interleave_3__iter__, /*tp_iter*/ __pyx_pw_7cytoolz_9itertoolz_10interleave_5__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz_interleave, /*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_7cytoolz_9itertoolz_interleave, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__unique_key(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__unique_key *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_7cytoolz_9itertoolz__unique_key *)o); p->key = Py_None; Py_INCREF(Py_None); p->iter_seq = Py_None; Py_INCREF(Py_None); p->seen = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9itertoolz_11_unique_key_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9itertoolz__unique_key(PyObject *o) { struct __pyx_obj_7cytoolz_9itertoolz__unique_key *p = (struct __pyx_obj_7cytoolz_9itertoolz__unique_key *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->key); Py_CLEAR(p->iter_seq); Py_CLEAR(p->seen); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9itertoolz__unique_key(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9itertoolz__unique_key *p = (struct __pyx_obj_7cytoolz_9itertoolz__unique_key *)o; if (p->key) { e = (*v)(p->key, a); if (e) return e; } if (p->iter_seq) { e = (*v)(p->iter_seq, a); if (e) return e; } if (p->seen) { e = (*v)(p->seen, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9itertoolz__unique_key(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9itertoolz__unique_key *p = (struct __pyx_obj_7cytoolz_9itertoolz__unique_key *)o; tmp = ((PyObject*)p->key); p->key = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->iter_seq); p->iter_seq = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->seen); p->seen = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_11_unique_key_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_11_unique_key_5__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__unique_key[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_11_unique_key_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11_unique_key_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_11_unique_key_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11_unique_key_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_11_unique_key_8__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__unique_key = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._unique_key", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__unique_key), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__unique_key, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__unique_key, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__unique_key, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_7cytoolz_9itertoolz_11_unique_key_3__iter__, /*tp_iter*/ __pyx_pw_7cytoolz_9itertoolz_11_unique_key_5__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz__unique_key, /*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_7cytoolz_9itertoolz__unique_key, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__unique_identity(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *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_7cytoolz_9itertoolz__unique_identity *)o); p->iter_seq = Py_None; Py_INCREF(Py_None); p->seen = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9itertoolz_16_unique_identity_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9itertoolz__unique_identity(PyObject *o) { struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *p = (struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->iter_seq); Py_CLEAR(p->seen); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9itertoolz__unique_identity(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *p = (struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *)o; if (p->iter_seq) { e = (*v)(p->iter_seq, a); if (e) return e; } if (p->seen) { e = (*v)(p->seen, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9itertoolz__unique_identity(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *p = (struct __pyx_obj_7cytoolz_9itertoolz__unique_identity *)o; tmp = ((PyObject*)p->iter_seq); p->iter_seq = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->seen); p->seen = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_16_unique_identity_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_16_unique_identity_5__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__unique_identity[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_16_unique_identity_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_16_unique_identity_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_16_unique_identity_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_16_unique_identity_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_16_unique_identity_8__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__unique_identity = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._unique_identity", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__unique_identity), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__unique_identity, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__unique_identity, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__unique_identity, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_7cytoolz_9itertoolz_16_unique_identity_3__iter__, /*tp_iter*/ __pyx_pw_7cytoolz_9itertoolz_16_unique_identity_5__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz__unique_identity, /*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_7cytoolz_9itertoolz__unique_identity, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_interpose(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz_interpose *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_7cytoolz_9itertoolz_interpose *)o); p->el = Py_None; Py_INCREF(Py_None); p->iter_seq = Py_None; Py_INCREF(Py_None); p->val = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9itertoolz_9interpose_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9itertoolz_interpose(PyObject *o) { struct __pyx_obj_7cytoolz_9itertoolz_interpose *p = (struct __pyx_obj_7cytoolz_9itertoolz_interpose *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->el); Py_CLEAR(p->iter_seq); Py_CLEAR(p->val); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9itertoolz_interpose(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9itertoolz_interpose *p = (struct __pyx_obj_7cytoolz_9itertoolz_interpose *)o; if (p->el) { e = (*v)(p->el, a); if (e) return e; } if (p->iter_seq) { e = (*v)(p->iter_seq, a); if (e) return e; } if (p->val) { e = (*v)(p->val, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9itertoolz_interpose(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9itertoolz_interpose *p = (struct __pyx_obj_7cytoolz_9itertoolz_interpose *)o; tmp = ((PyObject*)p->el); p->el = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->iter_seq); p->iter_seq = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->val); p->val = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_9interpose_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_9interpose_5__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz_interpose[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_9interpose_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_9interpose_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_9interpose_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_9interpose_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_9interpose_8__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz_interpose = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz.interpose", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz_interpose), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz_interpose, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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*/ " interpose(el, seq)\n\n Introduce element between each pair of elements in seq\n\n >>> list(interpose(\"a\", [1, 2, 3]))\n [1, 'a', 2, 'a', 3]\n ", /*tp_doc*/ __pyx_tp_traverse_7cytoolz_9itertoolz_interpose, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz_interpose, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_7cytoolz_9itertoolz_9interpose_3__iter__, /*tp_iter*/ __pyx_pw_7cytoolz_9itertoolz_9interpose_5__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz_interpose, /*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_7cytoolz_9itertoolz_interpose, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_iterate(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz_iterate *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_7cytoolz_9itertoolz_iterate *)o); p->func = Py_None; Py_INCREF(Py_None); p->x = Py_None; Py_INCREF(Py_None); p->val = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9itertoolz_7iterate_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9itertoolz_iterate(PyObject *o) { struct __pyx_obj_7cytoolz_9itertoolz_iterate *p = (struct __pyx_obj_7cytoolz_9itertoolz_iterate *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && 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->x); Py_CLEAR(p->val); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9itertoolz_iterate(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9itertoolz_iterate *p = (struct __pyx_obj_7cytoolz_9itertoolz_iterate *)o; if (p->func) { e = (*v)(p->func, a); if (e) return e; } if (p->x) { e = (*v)(p->x, a); if (e) return e; } if (p->val) { e = (*v)(p->val, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9itertoolz_iterate(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9itertoolz_iterate *p = (struct __pyx_obj_7cytoolz_9itertoolz_iterate *)o; tmp = ((PyObject*)p->func); p->func = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->x); p->x = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->val); p->val = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_7iterate_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_7iterate_5__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz_iterate[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_7iterate_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_7iterate_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_7iterate_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_7iterate_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_7iterate_8__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz_iterate = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz.iterate", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz_iterate), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz_iterate, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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*/ " iterate(func, x)\n\n Repeatedly apply a function func onto an original input\n\n Yields x, then func(x), then func(func(x)), then func(func(func(x))), etc..\n\n >>> def inc(x): return x + 1\n >>> counter = iterate(inc, 0)\n >>> next(counter)\n 0\n >>> next(counter)\n 1\n >>> next(counter)\n 2\n\n >>> double = lambda x: x * 2\n >>> powers_of_two = iterate(double, 1)\n >>> next(powers_of_two)\n 1\n >>> next(powers_of_two)\n 2\n >>> next(powers_of_two)\n 4\n >>> next(powers_of_two)\n 8\n ", /*tp_doc*/ __pyx_tp_traverse_7cytoolz_9itertoolz_iterate, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz_iterate, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_7cytoolz_9itertoolz_7iterate_3__iter__, /*tp_iter*/ __pyx_pw_7cytoolz_9itertoolz_7iterate_5__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz_iterate, /*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_7cytoolz_9itertoolz_iterate, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_sliding_window(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *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_7cytoolz_9itertoolz_sliding_window *)o); p->iterseq = Py_None; Py_INCREF(Py_None); p->prev = ((PyObject*)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9itertoolz_14sliding_window_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9itertoolz_sliding_window(PyObject *o) { struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *p = (struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->iterseq); Py_CLEAR(p->prev); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9itertoolz_sliding_window(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *p = (struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *)o; if (p->iterseq) { e = (*v)(p->iterseq, a); if (e) return e; } if (p->prev) { e = (*v)(p->prev, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9itertoolz_sliding_window(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *p = (struct __pyx_obj_7cytoolz_9itertoolz_sliding_window *)o; tmp = ((PyObject*)p->iterseq); p->iterseq = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->prev); p->prev = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_14sliding_window_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_14sliding_window_5__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz_sliding_window[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_14sliding_window_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_14sliding_window_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_14sliding_window_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_14sliding_window_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_14sliding_window_8__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz_sliding_window = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz.sliding_window", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz_sliding_window), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz_sliding_window, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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*/ " sliding_window(n, seq)\n\n A sequence of overlapping subsequences\n\n >>> list(sliding_window(2, [1, 2, 3, 4]))\n [(1, 2), (2, 3), (3, 4)]\n\n This function creates a sliding window suitable for transformations like\n sliding means / smoothing\n\n >>> mean = lambda seq: float(sum(seq)) / len(seq)\n >>> list(map(mean, sliding_window(2, [1, 2, 3, 4])))\n [1.5, 2.5, 3.5]\n ", /*tp_doc*/ __pyx_tp_traverse_7cytoolz_9itertoolz_sliding_window, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz_sliding_window, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_7cytoolz_9itertoolz_14sliding_window_3__iter__, /*tp_iter*/ __pyx_pw_7cytoolz_9itertoolz_14sliding_window_5__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz_sliding_window, /*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_7cytoolz_9itertoolz_sliding_window, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_partition_all(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz_partition_all *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_7cytoolz_9itertoolz_partition_all *)o); p->iterseq = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9itertoolz_13partition_all_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9itertoolz_partition_all(PyObject *o) { struct __pyx_obj_7cytoolz_9itertoolz_partition_all *p = (struct __pyx_obj_7cytoolz_9itertoolz_partition_all *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->iterseq); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9itertoolz_partition_all(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9itertoolz_partition_all *p = (struct __pyx_obj_7cytoolz_9itertoolz_partition_all *)o; if (p->iterseq) { e = (*v)(p->iterseq, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9itertoolz_partition_all(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9itertoolz_partition_all *p = (struct __pyx_obj_7cytoolz_9itertoolz_partition_all *)o; tmp = ((PyObject*)p->iterseq); p->iterseq = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_13partition_all_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_13partition_all_5__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz_partition_all[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_13partition_all_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_13partition_all_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_13partition_all_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_13partition_all_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_13partition_all_8__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz_partition_all = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz.partition_all", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz_partition_all), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz_partition_all, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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*/ " partition_all(n, seq)\n\n Partition all elements of sequence into tuples of length at most n\n\n The final tuple may be shorter to accommodate extra elements.\n\n >>> list(partition_all(2, [1, 2, 3, 4]))\n [(1, 2), (3, 4)]\n\n >>> list(partition_all(2, [1, 2, 3, 4, 5]))\n [(1, 2), (3, 4), (5,)]\n\n See Also:\n partition\n ", /*tp_doc*/ __pyx_tp_traverse_7cytoolz_9itertoolz_partition_all, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz_partition_all, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_7cytoolz_9itertoolz_13partition_all_3__iter__, /*tp_iter*/ __pyx_pw_7cytoolz_9itertoolz_13partition_all_5__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz_partition_all, /*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_7cytoolz_9itertoolz_partition_all, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__pluck_index(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *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_7cytoolz_9itertoolz__pluck_index *)o); p->ind = Py_None; Py_INCREF(Py_None); p->iterseqs = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9itertoolz_12_pluck_index_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9itertoolz__pluck_index(PyObject *o) { struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->ind); Py_CLEAR(p->iterseqs); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9itertoolz__pluck_index(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *)o; if (p->ind) { e = (*v)(p->ind, a); if (e) return e; } if (p->iterseqs) { e = (*v)(p->iterseqs, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9itertoolz__pluck_index(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_index *)o; tmp = ((PyObject*)p->ind); p->ind = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->iterseqs); p->iterseqs = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_12_pluck_index_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_12_pluck_index_5__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__pluck_index[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_12_pluck_index_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_12_pluck_index_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_12_pluck_index_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_12_pluck_index_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_12_pluck_index_8__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__pluck_index = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._pluck_index", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__pluck_index, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__pluck_index, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__pluck_index, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_7cytoolz_9itertoolz_12_pluck_index_3__iter__, /*tp_iter*/ __pyx_pw_7cytoolz_9itertoolz_12_pluck_index_5__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz__pluck_index, /*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_7cytoolz_9itertoolz__pluck_index, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__pluck_index_default(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *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_7cytoolz_9itertoolz__pluck_index_default *)o); p->ind = Py_None; Py_INCREF(Py_None); p->iterseqs = Py_None; Py_INCREF(Py_None); p->__pyx_default = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9itertoolz__pluck_index_default(PyObject *o) { struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->ind); Py_CLEAR(p->iterseqs); Py_CLEAR(p->__pyx_default); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9itertoolz__pluck_index_default(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *)o; if (p->ind) { e = (*v)(p->ind, a); if (e) return e; } if (p->iterseqs) { e = (*v)(p->iterseqs, a); if (e) return e; } if (p->__pyx_default) { e = (*v)(p->__pyx_default, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9itertoolz__pluck_index_default(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default *)o; tmp = ((PyObject*)p->ind); p->ind = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->iterseqs); p->iterseqs = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_default); p->__pyx_default = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_5__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__pluck_index_default[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_20_pluck_index_default_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_20_pluck_index_default_8__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__pluck_index_default = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._pluck_index_default", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__pluck_index_default, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__pluck_index_default, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__pluck_index_default, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_3__iter__, /*tp_iter*/ __pyx_pw_7cytoolz_9itertoolz_20_pluck_index_default_5__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz__pluck_index_default, /*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_7cytoolz_9itertoolz__pluck_index_default, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__pluck_list(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *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_7cytoolz_9itertoolz__pluck_list *)o); p->ind = ((PyObject*)Py_None); Py_INCREF(Py_None); p->iterseqs = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9itertoolz_11_pluck_list_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9itertoolz__pluck_list(PyObject *o) { struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->ind); Py_CLEAR(p->iterseqs); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9itertoolz__pluck_list(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *)o; if (p->ind) { e = (*v)(p->ind, a); if (e) return e; } if (p->iterseqs) { e = (*v)(p->iterseqs, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9itertoolz__pluck_list(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_list *)o; tmp = ((PyObject*)p->ind); p->ind = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->iterseqs); p->iterseqs = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_11_pluck_list_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_11_pluck_list_5__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__pluck_list[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_11_pluck_list_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11_pluck_list_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_11_pluck_list_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11_pluck_list_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_11_pluck_list_8__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__pluck_list = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._pluck_list", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__pluck_list, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__pluck_list, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__pluck_list, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_7cytoolz_9itertoolz_11_pluck_list_3__iter__, /*tp_iter*/ __pyx_pw_7cytoolz_9itertoolz_11_pluck_list_5__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz__pluck_list, /*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_7cytoolz_9itertoolz__pluck_list, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__pluck_list_default(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *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_7cytoolz_9itertoolz__pluck_list_default *)o); p->ind = ((PyObject*)Py_None); Py_INCREF(Py_None); p->iterseqs = Py_None; Py_INCREF(Py_None); p->__pyx_default = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9itertoolz__pluck_list_default(PyObject *o) { struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->ind); Py_CLEAR(p->iterseqs); Py_CLEAR(p->__pyx_default); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9itertoolz__pluck_list_default(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *)o; if (p->ind) { e = (*v)(p->ind, a); if (e) return e; } if (p->iterseqs) { e = (*v)(p->iterseqs, a); if (e) return e; } if (p->__pyx_default) { e = (*v)(p->__pyx_default, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9itertoolz__pluck_list_default(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *p = (struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default *)o; tmp = ((PyObject*)p->ind); p->ind = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->iterseqs); p->iterseqs = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_default); p->__pyx_default = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_5__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__pluck_list_default[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_19_pluck_list_default_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_19_pluck_list_default_8__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__pluck_list_default = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._pluck_list_default", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__pluck_list_default, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__pluck_list_default, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__pluck_list_default, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_3__iter__, /*tp_iter*/ __pyx_pw_7cytoolz_9itertoolz_19_pluck_list_default_5__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz__pluck_list_default, /*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_7cytoolz_9itertoolz__pluck_list_default, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__getter_index(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__getter_index *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_7cytoolz_9itertoolz__getter_index *)o); p->ind = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9itertoolz_13_getter_index_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9itertoolz__getter_index(PyObject *o) { struct __pyx_obj_7cytoolz_9itertoolz__getter_index *p = (struct __pyx_obj_7cytoolz_9itertoolz__getter_index *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->ind); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9itertoolz__getter_index(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9itertoolz__getter_index *p = (struct __pyx_obj_7cytoolz_9itertoolz__getter_index *)o; if (p->ind) { e = (*v)(p->ind, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9itertoolz__getter_index(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9itertoolz__getter_index *p = (struct __pyx_obj_7cytoolz_9itertoolz__getter_index *)o; tmp = ((PyObject*)p->ind); p->ind = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__getter_index[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_13_getter_index_5__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_13_getter_index_4__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_13_getter_index_7__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_13_getter_index_6__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__getter_index = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._getter_index", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__getter_index), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__getter_index, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_7cytoolz_9itertoolz_13_getter_index_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_7cytoolz_9itertoolz__getter_index, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__getter_index, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz__getter_index, /*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_7cytoolz_9itertoolz__getter_index, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__getter_list(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__getter_list *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_7cytoolz_9itertoolz__getter_list *)o); p->ind = ((PyObject*)Py_None); Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9itertoolz_12_getter_list_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9itertoolz__getter_list(PyObject *o) { struct __pyx_obj_7cytoolz_9itertoolz__getter_list *p = (struct __pyx_obj_7cytoolz_9itertoolz__getter_list *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->ind); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9itertoolz__getter_list(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9itertoolz__getter_list *p = (struct __pyx_obj_7cytoolz_9itertoolz__getter_list *)o; if (p->ind) { e = (*v)(p->ind, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9itertoolz__getter_list(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9itertoolz__getter_list *p = (struct __pyx_obj_7cytoolz_9itertoolz__getter_list *)o; tmp = ((PyObject*)p->ind); p->ind = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__getter_list[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_12_getter_list_5__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_12_getter_list_4__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_12_getter_list_7__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_12_getter_list_6__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__getter_list = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._getter_list", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__getter_list), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__getter_list, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_7cytoolz_9itertoolz_12_getter_list_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_7cytoolz_9itertoolz__getter_list, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__getter_list, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz__getter_list, /*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_7cytoolz_9itertoolz__getter_list, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__getter_null(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_7cytoolz_9itertoolz__getter_null(PyObject *o) { #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && 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_7cytoolz_9itertoolz__getter_null[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_12_getter_null_3__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_12_getter_null_2__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_12_getter_null_5__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_12_getter_null_4__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__getter_null = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._getter_null", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__getter_null), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__getter_null, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #endif 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ __pyx_pw_7cytoolz_9itertoolz_12_getter_null_1__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, /*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_7cytoolz_9itertoolz__getter_null, /*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_7cytoolz_9itertoolz__getter_null, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__join __pyx_vtable_7cytoolz_9itertoolz__join; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__join(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__join *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_7cytoolz_9itertoolz__join *)o); p->__pyx_vtab = __pyx_vtabptr_7cytoolz_9itertoolz__join; p->d = ((PyObject*)Py_None); Py_INCREF(Py_None); p->matches = ((PyObject*)Py_None); Py_INCREF(Py_None); p->seen_keys = ((PyObject*)Py_None); Py_INCREF(Py_None); p->leftseq = Py_None; Py_INCREF(Py_None); p->rightseq = Py_None; Py_INCREF(Py_None); p->_rightkey = Py_None; Py_INCREF(Py_None); p->right = Py_None; Py_INCREF(Py_None); p->left_default = Py_None; Py_INCREF(Py_None); p->right_default = Py_None; Py_INCREF(Py_None); p->keys = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9itertoolz_5_join_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9itertoolz__join(PyObject *o) { struct __pyx_obj_7cytoolz_9itertoolz__join *p = (struct __pyx_obj_7cytoolz_9itertoolz__join *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->d); Py_CLEAR(p->matches); Py_CLEAR(p->seen_keys); Py_CLEAR(p->leftseq); Py_CLEAR(p->rightseq); Py_CLEAR(p->_rightkey); Py_CLEAR(p->right); Py_CLEAR(p->left_default); Py_CLEAR(p->right_default); Py_CLEAR(p->keys); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9itertoolz__join(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9itertoolz__join *p = (struct __pyx_obj_7cytoolz_9itertoolz__join *)o; if (p->d) { e = (*v)(p->d, a); if (e) return e; } if (p->matches) { e = (*v)(p->matches, a); if (e) return e; } if (p->seen_keys) { e = (*v)(p->seen_keys, a); if (e) return e; } if (p->leftseq) { e = (*v)(p->leftseq, a); if (e) return e; } if (p->rightseq) { e = (*v)(p->rightseq, a); if (e) return e; } if (p->_rightkey) { e = (*v)(p->_rightkey, a); if (e) return e; } if (p->right) { e = (*v)(p->right, a); if (e) return e; } if (p->left_default) { e = (*v)(p->left_default, a); if (e) return e; } if (p->right_default) { e = (*v)(p->right_default, a); if (e) return e; } if (p->keys) { e = (*v)(p->keys, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9itertoolz__join(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9itertoolz__join *p = (struct __pyx_obj_7cytoolz_9itertoolz__join *)o; tmp = ((PyObject*)p->d); p->d = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->matches); p->matches = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->seen_keys); p->seen_keys = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->leftseq); p->leftseq = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->rightseq); p->rightseq = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_rightkey); p->_rightkey = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->right); p->right = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->left_default); p->left_default = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->right_default); p->right_default = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->keys); p->keys = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__join[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_5_join_5__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_5_join_4__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_5_join_7__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_5_join_6__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__join = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._join", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__join), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__join, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz__join, /*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_7cytoolz_9itertoolz__join, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join __pyx_vtable_7cytoolz_9itertoolz__inner_join; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__inner_join(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__inner_join *p; PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__join(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_7cytoolz_9itertoolz__inner_join *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__inner_join; return o; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_11_inner_join_1__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_11_inner_join_1__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__inner_join[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_11_inner_join_1__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11_inner_join_3__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_11_inner_join_2__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11_inner_join_5__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_11_inner_join_4__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__inner_join = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._inner_join", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__inner_join), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__join, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/ #else 0, /*tp_iter*/ #endif __pyx_pw_7cytoolz_9itertoolz_11_inner_join_1__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz__inner_join, /*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_7cytoolz_9itertoolz__inner_join, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join __pyx_vtable_7cytoolz_9itertoolz__right_outer_join; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__right_outer_join(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join *p; PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__join(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join; return o; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_1__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_1__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__right_outer_join[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_1__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_3__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_17_right_outer_join_2__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_5__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_17_right_outer_join_4__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__right_outer_join = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._right_outer_join", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__join, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/ #else 0, /*tp_iter*/ #endif __pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_1__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz__right_outer_join, /*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_7cytoolz_9itertoolz__right_outer_join, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join __pyx_vtable_7cytoolz_9itertoolz__left_outer_join; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__left_outer_join(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join *p; PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__join(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join; return o; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_1__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_1__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__left_outer_join[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_1__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_3__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_16_left_outer_join_2__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_5__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_16_left_outer_join_4__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__left_outer_join = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._left_outer_join", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__join, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/ #else 0, /*tp_iter*/ #endif __pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_1__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz__left_outer_join, /*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_7cytoolz_9itertoolz__left_outer_join, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join __pyx_vtable_7cytoolz_9itertoolz__outer_join; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__outer_join(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__outer_join *p; PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__join(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_7cytoolz_9itertoolz__outer_join *)o); p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__outer_join; return o; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_11_outer_join_1__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_11_outer_join_1__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__outer_join[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_11_outer_join_1__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11_outer_join_3__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_11_outer_join_2__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_11_outer_join_5__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_11_outer_join_4__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__outer_join = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._outer_join", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__outer_join), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__join, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/ #else 0, /*tp_iter*/ #endif __pyx_pw_7cytoolz_9itertoolz_11_outer_join_1__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz__outer_join, /*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_7cytoolz_9itertoolz__outer_join, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_key __pyx_vtable_7cytoolz_9itertoolz__inner_join_key; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__inner_join_key(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key *p; PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__inner_join(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__inner_join_key; return o; } static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__inner_join_key[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_15_inner_join_key_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_15_inner_join_key___reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_15_inner_join_key_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_15_inner_join_key_2__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__inner_join_key = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._inner_join_key", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__join, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/ #else 0, /*tp_iter*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_11_inner_join_1__next__, /*tp_iternext*/ #else 0, /*tp_iternext*/ #endif __pyx_methods_7cytoolz_9itertoolz__inner_join_key, /*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_7cytoolz_9itertoolz__inner_join_key, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_index __pyx_vtable_7cytoolz_9itertoolz__inner_join_index; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__inner_join_index(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index *p; PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__inner_join(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__inner_join_index; return o; } static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__inner_join_index[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_17_inner_join_index_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_17_inner_join_index___reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_17_inner_join_index_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_17_inner_join_index_2__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__inner_join_index = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._inner_join_index", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__join, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/ #else 0, /*tp_iter*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_11_inner_join_1__next__, /*tp_iternext*/ #else 0, /*tp_iternext*/ #endif __pyx_methods_7cytoolz_9itertoolz__inner_join_index, /*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_7cytoolz_9itertoolz__inner_join_index, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_indices __pyx_vtable_7cytoolz_9itertoolz__inner_join_indices; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__inner_join_indices(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices *p; PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__inner_join(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__inner_join_indices; return o; } static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__inner_join_indices[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_19_inner_join_indices_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_19_inner_join_indices___reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_19_inner_join_indices_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_19_inner_join_indices_2__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__inner_join_indices = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._inner_join_indices", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__join, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/ #else 0, /*tp_iter*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_11_inner_join_1__next__, /*tp_iternext*/ #else 0, /*tp_iternext*/ #endif __pyx_methods_7cytoolz_9itertoolz__inner_join_indices, /*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_7cytoolz_9itertoolz__inner_join_indices, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_key __pyx_vtable_7cytoolz_9itertoolz__right_outer_join_key; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__right_outer_join_key(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key *p; PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__right_outer_join(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_key; return o; } static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__right_outer_join_key[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_21_right_outer_join_key_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_21_right_outer_join_key___reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_21_right_outer_join_key_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_21_right_outer_join_key_2__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__right_outer_join_key = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._right_outer_join_key", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__join, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/ #else 0, /*tp_iter*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_1__next__, /*tp_iternext*/ #else 0, /*tp_iternext*/ #endif __pyx_methods_7cytoolz_9itertoolz__right_outer_join_key, /*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_7cytoolz_9itertoolz__right_outer_join_key, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_index __pyx_vtable_7cytoolz_9itertoolz__right_outer_join_index; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__right_outer_join_index(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index *p; PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__right_outer_join(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_index; return o; } static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__right_outer_join_index[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_23_right_outer_join_index_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_23_right_outer_join_index___reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_23_right_outer_join_index_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_23_right_outer_join_index_2__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__right_outer_join_index = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._right_outer_join_index", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__join, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/ #else 0, /*tp_iter*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_1__next__, /*tp_iternext*/ #else 0, /*tp_iternext*/ #endif __pyx_methods_7cytoolz_9itertoolz__right_outer_join_index, /*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_7cytoolz_9itertoolz__right_outer_join_index, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_indices __pyx_vtable_7cytoolz_9itertoolz__right_outer_join_indices; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__right_outer_join_indices(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices *p; PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__right_outer_join(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_indices; return o; } static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__right_outer_join_indices[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_25_right_outer_join_indices_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_25_right_outer_join_indices___reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_25_right_outer_join_indices_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_25_right_outer_join_indices_2__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__right_outer_join_indices = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._right_outer_join_indices", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__join, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/ #else 0, /*tp_iter*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_17_right_outer_join_1__next__, /*tp_iternext*/ #else 0, /*tp_iternext*/ #endif __pyx_methods_7cytoolz_9itertoolz__right_outer_join_indices, /*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_7cytoolz_9itertoolz__right_outer_join_indices, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_key __pyx_vtable_7cytoolz_9itertoolz__left_outer_join_key; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__left_outer_join_key(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key *p; PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__left_outer_join(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_key; return o; } static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__left_outer_join_key[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_20_left_outer_join_key_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_20_left_outer_join_key___reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_20_left_outer_join_key_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_20_left_outer_join_key_2__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__left_outer_join_key = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._left_outer_join_key", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__join, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/ #else 0, /*tp_iter*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_1__next__, /*tp_iternext*/ #else 0, /*tp_iternext*/ #endif __pyx_methods_7cytoolz_9itertoolz__left_outer_join_key, /*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_7cytoolz_9itertoolz__left_outer_join_key, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_index __pyx_vtable_7cytoolz_9itertoolz__left_outer_join_index; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__left_outer_join_index(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index *p; PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__left_outer_join(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_index; return o; } static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__left_outer_join_index[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_22_left_outer_join_index_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_22_left_outer_join_index___reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_22_left_outer_join_index_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_22_left_outer_join_index_2__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__left_outer_join_index = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._left_outer_join_index", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__join, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/ #else 0, /*tp_iter*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_1__next__, /*tp_iternext*/ #else 0, /*tp_iternext*/ #endif __pyx_methods_7cytoolz_9itertoolz__left_outer_join_index, /*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_7cytoolz_9itertoolz__left_outer_join_index, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_indices __pyx_vtable_7cytoolz_9itertoolz__left_outer_join_indices; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__left_outer_join_indices(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices *p; PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__left_outer_join(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_indices; return o; } static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__left_outer_join_indices[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_24_left_outer_join_indices_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_24_left_outer_join_indices___reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_24_left_outer_join_indices_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_24_left_outer_join_indices_2__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__left_outer_join_indices = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._left_outer_join_indices", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__join, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/ #else 0, /*tp_iter*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_16_left_outer_join_1__next__, /*tp_iternext*/ #else 0, /*tp_iternext*/ #endif __pyx_methods_7cytoolz_9itertoolz__left_outer_join_indices, /*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_7cytoolz_9itertoolz__left_outer_join_indices, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_key __pyx_vtable_7cytoolz_9itertoolz__outer_join_key; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__outer_join_key(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key *p; PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__outer_join(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__outer_join_key; return o; } static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__outer_join_key[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_15_outer_join_key_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_15_outer_join_key___reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_15_outer_join_key_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_15_outer_join_key_2__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__outer_join_key = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._outer_join_key", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__join, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/ #else 0, /*tp_iter*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_11_outer_join_1__next__, /*tp_iternext*/ #else 0, /*tp_iternext*/ #endif __pyx_methods_7cytoolz_9itertoolz__outer_join_key, /*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_7cytoolz_9itertoolz__outer_join_key, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_index __pyx_vtable_7cytoolz_9itertoolz__outer_join_index; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__outer_join_index(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index *p; PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__outer_join(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__outer_join_index; return o; } static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__outer_join_index[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_17_outer_join_index_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_17_outer_join_index___reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_17_outer_join_index_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_17_outer_join_index_2__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__outer_join_index = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._outer_join_index", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__join, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/ #else 0, /*tp_iter*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_11_outer_join_1__next__, /*tp_iternext*/ #else 0, /*tp_iternext*/ #endif __pyx_methods_7cytoolz_9itertoolz__outer_join_index, /*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_7cytoolz_9itertoolz__outer_join_index, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_indices __pyx_vtable_7cytoolz_9itertoolz__outer_join_indices; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__outer_join_indices(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices *p; PyObject *o = __pyx_tp_new_7cytoolz_9itertoolz__outer_join(t, a, k); if (unlikely(!o)) return 0; p = ((struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices *)o); p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__pyx_vtabptr_7cytoolz_9itertoolz__outer_join_indices; return o; } static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__outer_join_indices[] = { {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_19_outer_join_indices_1__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_19_outer_join_indices___reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_19_outer_join_indices_3__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_19_outer_join_indices_2__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__outer_join_indices = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._outer_join_indices", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__join, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__join, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__join, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_5_join_3__iter__, /*tp_iter*/ #else 0, /*tp_iter*/ #endif #if CYTHON_COMPILING_IN_PYPY __pyx_pw_7cytoolz_9itertoolz_11_outer_join_1__next__, /*tp_iternext*/ #else 0, /*tp_iternext*/ #endif __pyx_methods_7cytoolz_9itertoolz__outer_join_indices, /*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_7cytoolz_9itertoolz__outer_join_indices, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__diff_key(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__diff_key *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_7cytoolz_9itertoolz__diff_key *)o); p->iters = Py_None; Py_INCREF(Py_None); p->key = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9itertoolz_9_diff_key_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9itertoolz__diff_key(PyObject *o) { struct __pyx_obj_7cytoolz_9itertoolz__diff_key *p = (struct __pyx_obj_7cytoolz_9itertoolz__diff_key *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->iters); Py_CLEAR(p->key); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9itertoolz__diff_key(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9itertoolz__diff_key *p = (struct __pyx_obj_7cytoolz_9itertoolz__diff_key *)o; if (p->iters) { e = (*v)(p->iters, a); if (e) return e; } if (p->key) { e = (*v)(p->key, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9itertoolz__diff_key(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9itertoolz__diff_key *p = (struct __pyx_obj_7cytoolz_9itertoolz__diff_key *)o; tmp = ((PyObject*)p->iters); p->iters = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->key); p->key = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_9_diff_key_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_9_diff_key_5__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__diff_key[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_9_diff_key_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_9_diff_key_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_9_diff_key_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_9_diff_key_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_9_diff_key_8__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__diff_key = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._diff_key", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__diff_key), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__diff_key, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__diff_key, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__diff_key, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_7cytoolz_9itertoolz_9_diff_key_3__iter__, /*tp_iter*/ __pyx_pw_7cytoolz_9itertoolz_9_diff_key_5__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz__diff_key, /*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_7cytoolz_9itertoolz__diff_key, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz__diff_identity(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *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_7cytoolz_9itertoolz__diff_identity *)o); p->iters = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9itertoolz_14_diff_identity_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9itertoolz__diff_identity(PyObject *o) { struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *p = (struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->iters); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9itertoolz__diff_identity(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *p = (struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *)o; if (p->iters) { e = (*v)(p->iters, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9itertoolz__diff_identity(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *p = (struct __pyx_obj_7cytoolz_9itertoolz__diff_identity *)o; tmp = ((PyObject*)p->iters); p->iters = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_14_diff_identity_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_14_diff_identity_5__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz__diff_identity[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_14_diff_identity_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_14_diff_identity_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_14_diff_identity_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_14_diff_identity_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_14_diff_identity_8__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz__diff_identity = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz._diff_identity", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz__diff_identity), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz__diff_identity, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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_7cytoolz_9itertoolz__diff_identity, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz__diff_identity, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_7cytoolz_9itertoolz_14_diff_identity_3__iter__, /*tp_iter*/ __pyx_pw_7cytoolz_9itertoolz_14_diff_identity_5__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz__diff_identity, /*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_7cytoolz_9itertoolz__diff_identity, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyObject *__pyx_tp_new_7cytoolz_9itertoolz_random_sample(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_9itertoolz_random_sample *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_7cytoolz_9itertoolz_random_sample *)o); p->iter_seq = Py_None; Py_INCREF(Py_None); p->prob = Py_None; Py_INCREF(Py_None); p->random_func = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_9itertoolz_13random_sample_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_9itertoolz_random_sample(PyObject *o) { struct __pyx_obj_7cytoolz_9itertoolz_random_sample *p = (struct __pyx_obj_7cytoolz_9itertoolz_random_sample *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->iter_seq); Py_CLEAR(p->prob); Py_CLEAR(p->random_func); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_9itertoolz_random_sample(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_9itertoolz_random_sample *p = (struct __pyx_obj_7cytoolz_9itertoolz_random_sample *)o; if (p->iter_seq) { e = (*v)(p->iter_seq, a); if (e) return e; } if (p->prob) { e = (*v)(p->prob, a); if (e) return e; } if (p->random_func) { e = (*v)(p->random_func, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_9itertoolz_random_sample(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_9itertoolz_random_sample *p = (struct __pyx_obj_7cytoolz_9itertoolz_random_sample *)o; tmp = ((PyObject*)p->iter_seq); p->iter_seq = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->prob); p->prob = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->random_func); p->random_func = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_13random_sample_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_9itertoolz_13random_sample_5__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_9itertoolz_random_sample[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_9itertoolz_13random_sample_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_13random_sample_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_9itertoolz_13random_sample_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_9itertoolz_13random_sample_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_9itertoolz_13random_sample_8__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_9itertoolz_random_sample = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.itertoolz.random_sample", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_9itertoolz_random_sample), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_9itertoolz_random_sample, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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*/ " random_sample(prob, seq, random_state=None)\n\n Return elements from a sequence with probability of prob\n\n Returns a lazy iterator of random items from seq.\n\n ``random_sample`` considers each item independently and without\n replacement. See below how the first time it returned 13 items and the\n next time it returned 6 items.\n\n >>> seq = list(range(100))\n >>> list(random_sample(0.1, seq)) # doctest: +SKIP\n [6, 9, 19, 35, 45, 50, 58, 62, 68, 72, 78, 86, 95]\n >>> list(random_sample(0.1, seq)) # doctest: +SKIP\n [6, 44, 54, 61, 69, 94]\n\n Providing an integer seed for ``random_state`` will result in\n deterministic sampling. Given the same seed it will return the same sample\n every time.\n\n >>> list(random_sample(0.1, seq, random_state=2016))\n [7, 9, 19, 25, 30, 32, 34, 48, 59, 60, 81, 98]\n >>> list(random_sample(0.1, seq, random_state=2016))\n [7, 9, 19, 25, 30, 32, 34, 48, 59, 60, 81, 98]\n\n ``random_state`` can also be any object with a method ``random`` that\n returns floats between 0.0 and 1.0 (exclusive).\n\n >>> from random import Random\n >>> randobj = Random(2016)\n >>> list(random_sample(0.1, seq, random_state=randobj))\n [7, 9, 19, 25, 30, 32, 34, 48, 59, 60, 81, 98]\n ", /*tp_doc*/ __pyx_tp_traverse_7cytoolz_9itertoolz_random_sample, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_9itertoolz_random_sample, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_7cytoolz_9itertoolz_13random_sample_3__iter__, /*tp_iter*/ __pyx_pw_7cytoolz_9itertoolz_13random_sample_5__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_9itertoolz_random_sample, /*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_7cytoolz_9itertoolz_random_sample, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_itertoolz(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_itertoolz}, {0, NULL} }; #endif static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, "itertoolz", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_Add_el_to_beginning_of_possibly, __pyx_k_Add_el_to_beginning_of_possibly, sizeof(__pyx_k_Add_el_to_beginning_of_possibly), 0, 1, 0, 0}, {&__pyx_kp_u_All_values_in_sequence_are_dist, __pyx_k_All_values_in_sequence_are_dist, sizeof(__pyx_k_All_values_in_sequence_are_dist), 0, 1, 0, 0}, {&__pyx_kp_u_Apply_func_to_each_sequence_in, __pyx_k_Apply_func_to_each_sequence_in, sizeof(__pyx_k_Apply_func_to_each_sequence_in), 0, 1, 0, 0}, {&__pyx_kp_u_Concatenate_zero_or_more_iterab, __pyx_k_Concatenate_zero_or_more_iterab, sizeof(__pyx_k_Concatenate_zero_or_more_iterab), 0, 1, 0, 0}, {&__pyx_kp_u_Every_nth_item_in_seq_list_take, __pyx_k_Every_nth_item_in_seq_list_take, sizeof(__pyx_k_Every_nth_item_in_seq_list_take), 0, 1, 0, 0}, {&__pyx_kp_u_Find_number_of_occurrences_of_e, __pyx_k_Find_number_of_occurrences_of_e, sizeof(__pyx_k_Find_number_of_occurrences_of_e), 0, 1, 0, 0}, {&__pyx_kp_u_Find_the_k_largest_elements_of, __pyx_k_Find_the_k_largest_elements_of, sizeof(__pyx_k_Find_the_k_largest_elements_of), 0, 1, 0, 0}, {&__pyx_kp_u_Get_element_in_a_sequence_or_di, __pyx_k_Get_element_in_a_sequence_or_di, sizeof(__pyx_k_Get_element_in_a_sequence_or_di), 0, 1, 0, 0}, {&__pyx_kp_u_Group_a_collection_by_a_key_fun, __pyx_k_Group_a_collection_by_a_key_fun, sizeof(__pyx_k_Group_a_collection_by_a_key_fun), 0, 1, 0, 0}, {&__pyx_kp_s_Incompatible_checksums_s_vs_0xd4, __pyx_k_Incompatible_checksums_s_vs_0xd4, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xd4), 0, 0, 1, 0}, {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1}, {&__pyx_kp_u_Is_x_iterable_isiterable_1_2_3, __pyx_k_Is_x_iterable_isiterable_1_2_3, sizeof(__pyx_k_Is_x_iterable_isiterable_1_2_3), 0, 1, 0, 0}, {&__pyx_kp_u_Join_two_sequences_on_common_at, __pyx_k_Join_two_sequences_on_common_at, sizeof(__pyx_k_Join_two_sequences_on_common_at), 0, 1, 0, 0}, {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1}, {&__pyx_kp_u_Merge_and_sort_a_collection_of, __pyx_k_Merge_and_sort_a_collection_of, sizeof(__pyx_k_Merge_and_sort_a_collection_of), 0, 1, 0, 0}, {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1}, {&__pyx_kp_u_Partition_sequence_into_tuples, __pyx_k_Partition_sequence_into_tuples, sizeof(__pyx_k_Partition_sequence_into_tuples), 0, 1, 0, 0}, {&__pyx_kp_u_Perform_a_simultaneous_groupby, __pyx_k_Perform_a_simultaneous_groupby, sizeof(__pyx_k_Perform_a_simultaneous_groupby), 0, 1, 0, 0}, {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_Random, __pyx_k_Random, sizeof(__pyx_k_Random), 0, 0, 1, 1}, {&__pyx_kp_u_Retrieve_the_next_element_of_a, __pyx_k_Retrieve_the_next_element_of_a, sizeof(__pyx_k_Retrieve_the_next_element_of_a), 0, 1, 0, 0}, {&__pyx_kp_u_Retrieve_the_next_n_elements_of, __pyx_k_Retrieve_the_next_n_elements_of, sizeof(__pyx_k_Retrieve_the_next_n_elements_of), 0, 1, 0, 0}, {&__pyx_kp_u_Return_only_unique_elements_of, __pyx_k_Return_only_unique_elements_of, sizeof(__pyx_k_Return_only_unique_elements_of), 0, 1, 0, 0}, {&__pyx_kp_u_Return_those_items_that_differ, __pyx_k_Return_those_items_that_differ, sizeof(__pyx_k_Return_those_items_that_differ), 0, 1, 0, 0}, {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1}, {&__pyx_kp_u_The_first_element_in_a_sequence, __pyx_k_The_first_element_in_a_sequence, sizeof(__pyx_k_The_first_element_in_a_sequence), 0, 1, 0, 0}, {&__pyx_kp_u_The_first_n_elements_of_a_seque, __pyx_k_The_first_n_elements_of_a_seque, sizeof(__pyx_k_The_first_n_elements_of_a_seque), 0, 1, 0, 0}, {&__pyx_kp_u_The_last_element_in_a_sequence, __pyx_k_The_last_element_in_a_sequence, sizeof(__pyx_k_The_last_element_in_a_sequence), 0, 1, 0, 0}, {&__pyx_kp_u_The_last_n_elements_of_a_sequen, __pyx_k_The_last_n_elements_of_a_sequen, sizeof(__pyx_k_The_last_n_elements_of_a_sequen), 0, 1, 0, 0}, {&__pyx_kp_u_The_nth_element_in_a_sequence_n, __pyx_k_The_nth_element_in_a_sequence_n, sizeof(__pyx_k_The_nth_element_in_a_sequence_n), 0, 1, 0, 0}, {&__pyx_kp_u_The_second_element_in_a_sequenc, __pyx_k_The_second_element_in_a_sequenc, sizeof(__pyx_k_The_second_element_in_a_sequenc), 0, 1, 0, 0}, {&__pyx_kp_u_The_sequence_following_the_firs, __pyx_k_The_sequence_following_the_firs, sizeof(__pyx_k_The_sequence_following_the_firs), 0, 1, 0, 0}, {&__pyx_kp_s_Too_few_sequences_given_min_2_re, __pyx_k_Too_few_sequences_given_min_2_re, sizeof(__pyx_k_Too_few_sequences_given_min_2_re), 0, 0, 1, 0}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_kp_u_Variadic_version_of_concat_list, __pyx_k_Variadic_version_of_concat_list, sizeof(__pyx_k_Variadic_version_of_concat_list), 0, 1, 0, 0}, {&__pyx_n_s_accumulate, __pyx_k_accumulate, sizeof(__pyx_k_accumulate), 0, 0, 1, 1}, {&__pyx_n_s_accumulate___reduce_cython, __pyx_k_accumulate___reduce_cython, sizeof(__pyx_k_accumulate___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_accumulate___setstate_cython, __pyx_k_accumulate___setstate_cython, sizeof(__pyx_k_accumulate___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, {&__pyx_n_s_binop, __pyx_k_binop, sizeof(__pyx_k_binop), 0, 0, 1, 1}, {&__pyx_n_s_chain, __pyx_k_chain, sizeof(__pyx_k_chain), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, {&__pyx_n_s_concat, __pyx_k_concat, sizeof(__pyx_k_concat), 0, 0, 1, 1}, {&__pyx_kp_u_concat_line_697, __pyx_k_concat_line_697, sizeof(__pyx_k_concat_line_697), 0, 1, 0, 0}, {&__pyx_n_s_concatv, __pyx_k_concatv, sizeof(__pyx_k_concatv), 0, 0, 1, 1}, {&__pyx_kp_u_concatv_line_716, __pyx_k_concatv_line_716, sizeof(__pyx_k_concatv_line_716), 0, 1, 0, 0}, {&__pyx_n_s_cons, __pyx_k_cons, sizeof(__pyx_k_cons), 0, 0, 1, 1}, {&__pyx_kp_u_cons_line_740, __pyx_k_cons_line_740, sizeof(__pyx_k_cons_line_740), 0, 1, 0, 0}, {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1}, {&__pyx_n_s_cytoolz_compatibility, __pyx_k_cytoolz_compatibility, sizeof(__pyx_k_cytoolz_compatibility), 0, 0, 1, 1}, {&__pyx_n_s_cytoolz_itertoolz, __pyx_k_cytoolz_itertoolz, sizeof(__pyx_k_cytoolz_itertoolz), 0, 0, 1, 1}, {&__pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_k_cytoolz_itertoolz_pyx, sizeof(__pyx_k_cytoolz_itertoolz_pyx), 0, 0, 1, 0}, {&__pyx_n_s_cytoolz_utils, __pyx_k_cytoolz_utils, sizeof(__pyx_k_cytoolz_utils), 0, 0, 1, 1}, {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1}, {&__pyx_n_s_deque, __pyx_k_deque, sizeof(__pyx_k_deque), 0, 0, 1, 1}, {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1}, {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1}, {&__pyx_n_s_diff, __pyx_k_diff, sizeof(__pyx_k_diff), 0, 0, 1, 1}, {&__pyx_n_s_diff_identity, __pyx_k_diff_identity, sizeof(__pyx_k_diff_identity), 0, 0, 1, 1}, {&__pyx_n_s_diff_identity___reduce_cython, __pyx_k_diff_identity___reduce_cython, sizeof(__pyx_k_diff_identity___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_diff_identity___setstate_cython, __pyx_k_diff_identity___setstate_cython, sizeof(__pyx_k_diff_identity___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_diff_key, __pyx_k_diff_key, sizeof(__pyx_k_diff_key), 0, 0, 1, 1}, {&__pyx_n_s_diff_key___reduce_cython, __pyx_k_diff_key___reduce_cython, sizeof(__pyx_k_diff_key___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_diff_key___setstate_cython, __pyx_k_diff_key___setstate_cython, sizeof(__pyx_k_diff_key___setstate_cython), 0, 0, 1, 1}, {&__pyx_kp_u_diff_line_1620, __pyx_k_diff_line_1620, sizeof(__pyx_k_diff_line_1620), 0, 1, 0, 0}, {&__pyx_n_s_drop, __pyx_k_drop, sizeof(__pyx_k_drop), 0, 0, 1, 1}, {&__pyx_kp_u_drop_line_517, __pyx_k_drop_line_517, sizeof(__pyx_k_drop_line_517), 0, 1, 0, 0}, {&__pyx_n_s_el, __pyx_k_el, sizeof(__pyx_k_el), 0, 0, 1, 1}, {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, {&__pyx_n_s_fillvalue, __pyx_k_fillvalue, sizeof(__pyx_k_fillvalue), 0, 0, 1, 1}, {&__pyx_n_s_first, __pyx_k_first, sizeof(__pyx_k_first), 0, 0, 1, 1}, {&__pyx_kp_u_first_line_551, __pyx_k_first_line_551, sizeof(__pyx_k_first_line_551), 0, 1, 0, 0}, {&__pyx_n_s_frequencies, __pyx_k_frequencies, sizeof(__pyx_k_frequencies), 0, 0, 1, 1}, {&__pyx_kp_u_frequencies_line_780, __pyx_k_frequencies_line_780, sizeof(__pyx_k_frequencies_line_780), 0, 1, 0, 0}, {&__pyx_n_s_from_iterable, __pyx_k_from_iterable, sizeof(__pyx_k_from_iterable), 0, 0, 1, 1}, {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1}, {&__pyx_kp_u_get_line_619, __pyx_k_get_line_619, sizeof(__pyx_k_get_line_619), 0, 1, 0, 0}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_getter, __pyx_k_getter, sizeof(__pyx_k_getter), 0, 0, 1, 1}, {&__pyx_n_s_getter_index, __pyx_k_getter_index, sizeof(__pyx_k_getter_index), 0, 0, 1, 1}, {&__pyx_n_s_getter_index___reduce_cython, __pyx_k_getter_index___reduce_cython, sizeof(__pyx_k_getter_index___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_getter_index___setstate_cython, __pyx_k_getter_index___setstate_cython, sizeof(__pyx_k_getter_index___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_getter_list, __pyx_k_getter_list, sizeof(__pyx_k_getter_list), 0, 0, 1, 1}, {&__pyx_n_s_getter_list___reduce_cython, __pyx_k_getter_list___reduce_cython, sizeof(__pyx_k_getter_list___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_getter_list___setstate_cython, __pyx_k_getter_list___setstate_cython, sizeof(__pyx_k_getter_list___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_getter_null, __pyx_k_getter_null, sizeof(__pyx_k_getter_null), 0, 0, 1, 1}, {&__pyx_n_s_getter_null___reduce_cython, __pyx_k_getter_null___reduce_cython, sizeof(__pyx_k_getter_null___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_getter_null___setstate_cython, __pyx_k_getter_null___setstate_cython, sizeof(__pyx_k_getter_null___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_groupby, __pyx_k_groupby, sizeof(__pyx_k_groupby), 0, 0, 1, 1}, {&__pyx_kp_u_groupby_line_118, __pyx_k_groupby_line_118, sizeof(__pyx_k_groupby_line_118), 0, 1, 0, 0}, {&__pyx_n_s_heapify, __pyx_k_heapify, sizeof(__pyx_k_heapify), 0, 0, 1, 1}, {&__pyx_n_s_heappop, __pyx_k_heappop, sizeof(__pyx_k_heappop), 0, 0, 1, 1}, {&__pyx_n_s_heapq, __pyx_k_heapq, sizeof(__pyx_k_heapq), 0, 0, 1, 1}, {&__pyx_n_s_heapreplace, __pyx_k_heapreplace, sizeof(__pyx_k_heapreplace), 0, 0, 1, 1}, {&__pyx_n_s_identity, __pyx_k_identity, sizeof(__pyx_k_identity), 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_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1}, {&__pyx_n_s_initial, __pyx_k_initial, sizeof(__pyx_k_initial), 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___reduce_cython, __pyx_k_inner_join___reduce_cython, sizeof(__pyx_k_inner_join___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_inner_join___setstate_cython, __pyx_k_inner_join___setstate_cython, sizeof(__pyx_k_inner_join___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_inner_join_index, __pyx_k_inner_join_index, sizeof(__pyx_k_inner_join_index), 0, 0, 1, 1}, {&__pyx_n_s_inner_join_index___reduce_cytho, __pyx_k_inner_join_index___reduce_cytho, sizeof(__pyx_k_inner_join_index___reduce_cytho), 0, 0, 1, 1}, {&__pyx_n_s_inner_join_index___setstate_cyt, __pyx_k_inner_join_index___setstate_cyt, sizeof(__pyx_k_inner_join_index___setstate_cyt), 0, 0, 1, 1}, {&__pyx_n_s_inner_join_indices, __pyx_k_inner_join_indices, sizeof(__pyx_k_inner_join_indices), 0, 0, 1, 1}, {&__pyx_n_s_inner_join_indices___reduce_cyt, __pyx_k_inner_join_indices___reduce_cyt, sizeof(__pyx_k_inner_join_indices___reduce_cyt), 0, 0, 1, 1}, {&__pyx_n_s_inner_join_indices___setstate_c, __pyx_k_inner_join_indices___setstate_c, sizeof(__pyx_k_inner_join_indices___setstate_c), 0, 0, 1, 1}, {&__pyx_n_s_inner_join_key, __pyx_k_inner_join_key, sizeof(__pyx_k_inner_join_key), 0, 0, 1, 1}, {&__pyx_n_s_inner_join_key___reduce_cython, __pyx_k_inner_join_key___reduce_cython, sizeof(__pyx_k_inner_join_key___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_inner_join_key___setstate_cytho, __pyx_k_inner_join_key___setstate_cytho, sizeof(__pyx_k_inner_join_key___setstate_cytho), 0, 0, 1, 1}, {&__pyx_n_s_interleave, __pyx_k_interleave, sizeof(__pyx_k_interleave), 0, 0, 1, 1}, {&__pyx_n_s_interleave___reduce_cython, __pyx_k_interleave___reduce_cython, sizeof(__pyx_k_interleave___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_interleave___setstate_cython, __pyx_k_interleave___setstate_cython, sizeof(__pyx_k_interleave___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_interpose, __pyx_k_interpose, sizeof(__pyx_k_interpose), 0, 0, 1, 1}, {&__pyx_n_s_interpose___reduce_cython, __pyx_k_interpose___reduce_cython, sizeof(__pyx_k_interpose___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_interpose___setstate_cython, __pyx_k_interpose___setstate_cython, sizeof(__pyx_k_interpose___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_isdistinct, __pyx_k_isdistinct, sizeof(__pyx_k_isdistinct), 0, 0, 1, 1}, {&__pyx_kp_u_isdistinct_line_462, __pyx_k_isdistinct_line_462, sizeof(__pyx_k_isdistinct_line_462), 0, 1, 0, 0}, {&__pyx_n_s_isiterable, __pyx_k_isiterable, sizeof(__pyx_k_isiterable), 0, 0, 1, 1}, {&__pyx_kp_u_isiterable_line_443, __pyx_k_isiterable_line_443, sizeof(__pyx_k_isiterable_line_443), 0, 1, 0, 0}, {&__pyx_n_s_islice, __pyx_k_islice, sizeof(__pyx_k_islice), 0, 0, 1, 1}, {&__pyx_n_s_itemgetter, __pyx_k_itemgetter, sizeof(__pyx_k_itemgetter), 0, 0, 1, 1}, {&__pyx_n_s_iterate, __pyx_k_iterate, sizeof(__pyx_k_iterate), 0, 0, 1, 1}, {&__pyx_n_s_iterate___reduce_cython, __pyx_k_iterate___reduce_cython, sizeof(__pyx_k_iterate___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_iterate___setstate_cython, __pyx_k_iterate___setstate_cython, sizeof(__pyx_k_iterate___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1}, {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1}, {&__pyx_n_s_join_2, __pyx_k_join_2, sizeof(__pyx_k_join_2), 0, 0, 1, 1}, {&__pyx_n_s_join___reduce_cython, __pyx_k_join___reduce_cython, sizeof(__pyx_k_join___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_join___setstate_cython, __pyx_k_join___setstate_cython, sizeof(__pyx_k_join___setstate_cython), 0, 0, 1, 1}, {&__pyx_kp_u_join_line_1247, __pyx_k_join_line_1247, sizeof(__pyx_k_join_line_1247), 0, 1, 0, 0}, {&__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_last, __pyx_k_last, sizeof(__pyx_k_last), 0, 0, 1, 1}, {&__pyx_kp_u_last_line_591, __pyx_k_last_line_591, sizeof(__pyx_k_last_line_591), 0, 1, 0, 0}, {&__pyx_n_s_left_default, __pyx_k_left_default, sizeof(__pyx_k_left_default), 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_outer_join___reduce_cython, __pyx_k_left_outer_join___reduce_cython, sizeof(__pyx_k_left_outer_join___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_left_outer_join___setstate_cyth, __pyx_k_left_outer_join___setstate_cyth, sizeof(__pyx_k_left_outer_join___setstate_cyth), 0, 0, 1, 1}, {&__pyx_n_s_left_outer_join_index, __pyx_k_left_outer_join_index, sizeof(__pyx_k_left_outer_join_index), 0, 0, 1, 1}, {&__pyx_n_s_left_outer_join_index___reduce, __pyx_k_left_outer_join_index___reduce, sizeof(__pyx_k_left_outer_join_index___reduce), 0, 0, 1, 1}, {&__pyx_n_s_left_outer_join_index___setstat, __pyx_k_left_outer_join_index___setstat, sizeof(__pyx_k_left_outer_join_index___setstat), 0, 0, 1, 1}, {&__pyx_n_s_left_outer_join_indices, __pyx_k_left_outer_join_indices, sizeof(__pyx_k_left_outer_join_indices), 0, 0, 1, 1}, {&__pyx_n_s_left_outer_join_indices___reduc, __pyx_k_left_outer_join_indices___reduc, sizeof(__pyx_k_left_outer_join_indices___reduc), 0, 0, 1, 1}, {&__pyx_n_s_left_outer_join_indices___setst, __pyx_k_left_outer_join_indices___setst, sizeof(__pyx_k_left_outer_join_indices___setst), 0, 0, 1, 1}, {&__pyx_n_s_left_outer_join_key, __pyx_k_left_outer_join_key, sizeof(__pyx_k_left_outer_join_key), 0, 0, 1, 1}, {&__pyx_n_s_left_outer_join_key___reduce_cy, __pyx_k_left_outer_join_key___reduce_cy, sizeof(__pyx_k_left_outer_join_key___reduce_cy), 0, 0, 1, 1}, {&__pyx_n_s_left_outer_join_key___setstate, __pyx_k_left_outer_join_key___setstate, sizeof(__pyx_k_left_outer_join_key___setstate), 0, 0, 1, 1}, {&__pyx_n_s_leftkey, __pyx_k_leftkey, sizeof(__pyx_k_leftkey), 0, 0, 1, 1}, {&__pyx_n_s_leftseq, __pyx_k_leftseq, sizeof(__pyx_k_leftseq), 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_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1}, {&__pyx_n_s_mapcat, __pyx_k_mapcat, sizeof(__pyx_k_mapcat), 0, 0, 1, 1}, {&__pyx_kp_u_mapcat_line_729, __pyx_k_mapcat_line_729, sizeof(__pyx_k_mapcat_line_729), 0, 1, 0, 0}, {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, {&__pyx_n_s_merge_sorted, __pyx_k_merge_sorted, sizeof(__pyx_k_merge_sorted), 0, 0, 1, 1}, {&__pyx_n_s_merge_sorted_2, __pyx_k_merge_sorted_2, sizeof(__pyx_k_merge_sorted_2), 0, 0, 1, 1}, {&__pyx_n_s_merge_sorted___reduce_cython, __pyx_k_merge_sorted___reduce_cython, sizeof(__pyx_k_merge_sorted___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_merge_sorted___setstate_cython, __pyx_k_merge_sorted___setstate_cython, sizeof(__pyx_k_merge_sorted___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_merge_sorted_key, __pyx_k_merge_sorted_key, sizeof(__pyx_k_merge_sorted_key), 0, 0, 1, 1}, {&__pyx_n_s_merge_sorted_key___reduce_cytho, __pyx_k_merge_sorted_key___reduce_cytho, sizeof(__pyx_k_merge_sorted_key___reduce_cytho), 0, 0, 1, 1}, {&__pyx_n_s_merge_sorted_key___setstate_cyt, __pyx_k_merge_sorted_key___setstate_cyt, sizeof(__pyx_k_merge_sorted_key___setstate_cyt), 0, 0, 1, 1}, {&__pyx_kp_u_merge_sorted_line_295, __pyx_k_merge_sorted_line_295, sizeof(__pyx_k_merge_sorted_line_295), 0, 1, 0, 0}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_kp_s_n_argument_for_drop_must_be_non, __pyx_k_n_argument_for_drop_must_be_non, sizeof(__pyx_k_n_argument_for_drop_must_be_non), 0, 0, 1, 0}, {&__pyx_kp_s_n_must_be_positive_when_indexin, __pyx_k_n_must_be_positive_when_indexin, sizeof(__pyx_k_n_must_be_positive_when_indexin), 0, 0, 1, 0}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, {&__pyx_n_s_no__default, __pyx_k_no__default, sizeof(__pyx_k_no__default), 0, 0, 1, 1}, {&__pyx_n_s_no__pad, __pyx_k_no__pad, sizeof(__pyx_k_no__pad), 0, 0, 1, 1}, {&__pyx_n_s_no_default, __pyx_k_no_default, sizeof(__pyx_k_no_default), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_no_pad, __pyx_k_no_pad, sizeof(__pyx_k_no_pad), 0, 0, 1, 1}, {&__pyx_n_s_nth, __pyx_k_nth, sizeof(__pyx_k_nth), 0, 0, 1, 1}, {&__pyx_kp_u_nth_line_573, __pyx_k_nth_line_573, sizeof(__pyx_k_nth_line_573), 0, 1, 0, 0}, {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1}, {&__pyx_n_s_outer_join, __pyx_k_outer_join, sizeof(__pyx_k_outer_join), 0, 0, 1, 1}, {&__pyx_n_s_outer_join___reduce_cython, __pyx_k_outer_join___reduce_cython, sizeof(__pyx_k_outer_join___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_outer_join___setstate_cython, __pyx_k_outer_join___setstate_cython, sizeof(__pyx_k_outer_join___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_outer_join_index, __pyx_k_outer_join_index, sizeof(__pyx_k_outer_join_index), 0, 0, 1, 1}, {&__pyx_n_s_outer_join_index___reduce_cytho, __pyx_k_outer_join_index___reduce_cytho, sizeof(__pyx_k_outer_join_index___reduce_cytho), 0, 0, 1, 1}, {&__pyx_n_s_outer_join_index___setstate_cyt, __pyx_k_outer_join_index___setstate_cyt, sizeof(__pyx_k_outer_join_index___setstate_cyt), 0, 0, 1, 1}, {&__pyx_n_s_outer_join_indices, __pyx_k_outer_join_indices, sizeof(__pyx_k_outer_join_indices), 0, 0, 1, 1}, {&__pyx_n_s_outer_join_indices___reduce_cyt, __pyx_k_outer_join_indices___reduce_cyt, sizeof(__pyx_k_outer_join_indices___reduce_cyt), 0, 0, 1, 1}, {&__pyx_n_s_outer_join_indices___setstate_c, __pyx_k_outer_join_indices___setstate_c, sizeof(__pyx_k_outer_join_indices___setstate_c), 0, 0, 1, 1}, {&__pyx_n_s_outer_join_key, __pyx_k_outer_join_key, sizeof(__pyx_k_outer_join_key), 0, 0, 1, 1}, {&__pyx_n_s_outer_join_key___reduce_cython, __pyx_k_outer_join_key___reduce_cython, sizeof(__pyx_k_outer_join_key___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_outer_join_key___setstate_cytho, __pyx_k_outer_join_key___setstate_cytho, sizeof(__pyx_k_outer_join_key___setstate_cytho), 0, 0, 1, 1}, {&__pyx_n_s_pad, __pyx_k_pad, sizeof(__pyx_k_pad), 0, 0, 1, 1}, {&__pyx_n_s_partition, __pyx_k_partition, sizeof(__pyx_k_partition), 0, 0, 1, 1}, {&__pyx_n_s_partition_all, __pyx_k_partition_all, sizeof(__pyx_k_partition_all), 0, 0, 1, 1}, {&__pyx_n_s_partition_all___reduce_cython, __pyx_k_partition_all___reduce_cython, sizeof(__pyx_k_partition_all___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_partition_all___setstate_cython, __pyx_k_partition_all___setstate_cython, sizeof(__pyx_k_partition_all___setstate_cython), 0, 0, 1, 1}, {&__pyx_kp_u_partition_line_995, __pyx_k_partition_line_995, sizeof(__pyx_k_partition_line_995), 0, 1, 0, 0}, {&__pyx_n_s_peek, __pyx_k_peek, sizeof(__pyx_k_peek), 0, 0, 1, 1}, {&__pyx_kp_u_peek_line_1718, __pyx_k_peek_line_1718, sizeof(__pyx_k_peek_line_1718), 0, 1, 0, 0}, {&__pyx_n_s_peekn, __pyx_k_peekn, sizeof(__pyx_k_peekn), 0, 0, 1, 1}, {&__pyx_kp_u_peekn_line_1737, __pyx_k_peekn_line_1737, sizeof(__pyx_k_peekn_line_1737), 0, 1, 0, 0}, {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1}, {&__pyx_n_s_pluck, __pyx_k_pluck, sizeof(__pyx_k_pluck), 0, 0, 1, 1}, {&__pyx_n_s_pluck_index, __pyx_k_pluck_index, sizeof(__pyx_k_pluck_index), 0, 0, 1, 1}, {&__pyx_n_s_pluck_index___reduce_cython, __pyx_k_pluck_index___reduce_cython, sizeof(__pyx_k_pluck_index___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_pluck_index___setstate_cython, __pyx_k_pluck_index___setstate_cython, sizeof(__pyx_k_pluck_index___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_pluck_index_default, __pyx_k_pluck_index_default, sizeof(__pyx_k_pluck_index_default), 0, 0, 1, 1}, {&__pyx_n_s_pluck_index_default___reduce_cy, __pyx_k_pluck_index_default___reduce_cy, sizeof(__pyx_k_pluck_index_default___reduce_cy), 0, 0, 1, 1}, {&__pyx_n_s_pluck_index_default___setstate, __pyx_k_pluck_index_default___setstate, sizeof(__pyx_k_pluck_index_default___setstate), 0, 0, 1, 1}, {&__pyx_kp_u_pluck_line_1171, __pyx_k_pluck_line_1171, sizeof(__pyx_k_pluck_line_1171), 0, 1, 0, 0}, {&__pyx_n_s_pluck_list, __pyx_k_pluck_list, sizeof(__pyx_k_pluck_list), 0, 0, 1, 1}, {&__pyx_n_s_pluck_list___reduce_cython, __pyx_k_pluck_list___reduce_cython, sizeof(__pyx_k_pluck_list___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_pluck_list___setstate_cython, __pyx_k_pluck_list___setstate_cython, sizeof(__pyx_k_pluck_list___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_pluck_list_default, __pyx_k_pluck_list_default, sizeof(__pyx_k_pluck_list_default), 0, 0, 1, 1}, {&__pyx_n_s_pluck_list_default___reduce_cyt, __pyx_k_pluck_list_default___reduce_cyt, sizeof(__pyx_k_pluck_list_default___reduce_cyt), 0, 0, 1, 1}, {&__pyx_n_s_pluck_list_default___setstate_c, __pyx_k_pluck_list_default___setstate_c, sizeof(__pyx_k_pluck_list_default___setstate_c), 0, 0, 1, 1}, {&__pyx_kp_u_plucks_an_element_or_several_el, __pyx_k_plucks_an_element_or_several_el, sizeof(__pyx_k_plucks_an_element_or_several_el), 0, 1, 0, 0}, {&__pyx_n_s_predicate, __pyx_k_predicate, sizeof(__pyx_k_predicate), 0, 0, 1, 1}, {&__pyx_n_s_prob, __pyx_k_prob, sizeof(__pyx_k_prob), 0, 0, 1, 1}, {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1}, {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1}, {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1}, {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1}, {&__pyx_n_s_pyx_unpickle__getter_null, __pyx_k_pyx_unpickle__getter_null, sizeof(__pyx_k_pyx_unpickle__getter_null), 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_random, __pyx_k_random, sizeof(__pyx_k_random), 0, 0, 1, 1}, {&__pyx_n_s_random_sample, __pyx_k_random_sample, sizeof(__pyx_k_random_sample), 0, 0, 1, 1}, {&__pyx_n_s_random_sample___reduce_cython, __pyx_k_random_sample___reduce_cython, sizeof(__pyx_k_random_sample___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_random_sample___setstate_cython, __pyx_k_random_sample___setstate_cython, sizeof(__pyx_k_random_sample___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_random_state, __pyx_k_random_state, sizeof(__pyx_k_random_state), 0, 0, 1, 1}, {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_reduceby, __pyx_k_reduceby, sizeof(__pyx_k_reduceby), 0, 0, 1, 1}, {&__pyx_kp_u_reduceby_line_817, __pyx_k_reduceby_line_817, sizeof(__pyx_k_reduceby_line_817), 0, 1, 0, 0}, {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1}, {&__pyx_n_s_remove___reduce_cython, __pyx_k_remove___reduce_cython, sizeof(__pyx_k_remove___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_remove___setstate_cython, __pyx_k_remove___setstate_cython, sizeof(__pyx_k_remove___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_rest, __pyx_k_rest, sizeof(__pyx_k_rest), 0, 0, 1, 1}, {&__pyx_n_s_reverse, __pyx_k_reverse, sizeof(__pyx_k_reverse), 0, 0, 1, 1}, {&__pyx_n_s_right_default, __pyx_k_right_default, sizeof(__pyx_k_right_default), 0, 0, 1, 1}, {&__pyx_n_s_right_outer_join, __pyx_k_right_outer_join, sizeof(__pyx_k_right_outer_join), 0, 0, 1, 1}, {&__pyx_n_s_right_outer_join___reduce_cytho, __pyx_k_right_outer_join___reduce_cytho, sizeof(__pyx_k_right_outer_join___reduce_cytho), 0, 0, 1, 1}, {&__pyx_n_s_right_outer_join___setstate_cyt, __pyx_k_right_outer_join___setstate_cyt, sizeof(__pyx_k_right_outer_join___setstate_cyt), 0, 0, 1, 1}, {&__pyx_n_s_right_outer_join_index, __pyx_k_right_outer_join_index, sizeof(__pyx_k_right_outer_join_index), 0, 0, 1, 1}, {&__pyx_n_s_right_outer_join_index___reduce, __pyx_k_right_outer_join_index___reduce, sizeof(__pyx_k_right_outer_join_index___reduce), 0, 0, 1, 1}, {&__pyx_n_s_right_outer_join_index___setsta, __pyx_k_right_outer_join_index___setsta, sizeof(__pyx_k_right_outer_join_index___setsta), 0, 0, 1, 1}, {&__pyx_n_s_right_outer_join_indices, __pyx_k_right_outer_join_indices, sizeof(__pyx_k_right_outer_join_indices), 0, 0, 1, 1}, {&__pyx_n_s_right_outer_join_indices___redu, __pyx_k_right_outer_join_indices___redu, sizeof(__pyx_k_right_outer_join_indices___redu), 0, 0, 1, 1}, {&__pyx_n_s_right_outer_join_indices___sets, __pyx_k_right_outer_join_indices___sets, sizeof(__pyx_k_right_outer_join_indices___sets), 0, 0, 1, 1}, {&__pyx_n_s_right_outer_join_key, __pyx_k_right_outer_join_key, sizeof(__pyx_k_right_outer_join_key), 0, 0, 1, 1}, {&__pyx_n_s_right_outer_join_key___reduce_c, __pyx_k_right_outer_join_key___reduce_c, sizeof(__pyx_k_right_outer_join_key___reduce_c), 0, 0, 1, 1}, {&__pyx_n_s_right_outer_join_key___setstate, __pyx_k_right_outer_join_key___setstate, sizeof(__pyx_k_right_outer_join_key___setstate), 0, 0, 1, 1}, {&__pyx_n_s_rightkey, __pyx_k_rightkey, sizeof(__pyx_k_rightkey), 0, 0, 1, 1}, {&__pyx_n_s_rightseq, __pyx_k_rightseq, sizeof(__pyx_k_rightseq), 0, 0, 1, 1}, {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1}, {&__pyx_kp_u_second_line_561, __pyx_k_second_line_561, sizeof(__pyx_k_second_line_561), 0, 1, 0, 0}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_seq, __pyx_k_seq, sizeof(__pyx_k_seq), 0, 0, 1, 1}, {&__pyx_n_s_seq1, __pyx_k_seq1, sizeof(__pyx_k_seq1), 0, 0, 1, 1}, {&__pyx_n_s_seq2, __pyx_k_seq2, sizeof(__pyx_k_seq2), 0, 0, 1, 1}, {&__pyx_n_s_seqs, __pyx_k_seqs, sizeof(__pyx_k_seqs), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_sliding_window, __pyx_k_sliding_window, sizeof(__pyx_k_sliding_window), 0, 0, 1, 1}, {&__pyx_n_s_sliding_window___reduce_cython, __pyx_k_sliding_window___reduce_cython, sizeof(__pyx_k_sliding_window___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_sliding_window___setstate_cython, __pyx_k_sliding_window___setstate_cython, sizeof(__pyx_k_sliding_window___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_sort, __pyx_k_sort, sizeof(__pyx_k_sort), 0, 0, 1, 1}, {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_tail, __pyx_k_tail, sizeof(__pyx_k_tail), 0, 0, 1, 1}, {&__pyx_kp_u_tail_line_501, __pyx_k_tail_line_501, sizeof(__pyx_k_tail_line_501), 0, 1, 0, 0}, {&__pyx_n_s_take, __pyx_k_take, sizeof(__pyx_k_take), 0, 0, 1, 1}, {&__pyx_kp_u_take_line_487, __pyx_k_take_line_487, sizeof(__pyx_k_take_line_487), 0, 1, 0, 0}, {&__pyx_n_s_take_nth, __pyx_k_take_nth, sizeof(__pyx_k_take_nth), 0, 0, 1, 1}, {&__pyx_kp_u_take_nth_line_541, __pyx_k_take_nth_line_541, sizeof(__pyx_k_take_nth_line_541), 0, 1, 0, 0}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_topk, __pyx_k_topk, sizeof(__pyx_k_topk), 0, 0, 1, 1}, {&__pyx_kp_u_topk_line_1646, __pyx_k_topk_line_1646, sizeof(__pyx_k_topk_line_1646), 0, 1, 0, 0}, {&__pyx_n_s_unique, __pyx_k_unique, sizeof(__pyx_k_unique), 0, 0, 1, 1}, {&__pyx_n_s_unique_identity, __pyx_k_unique_identity, sizeof(__pyx_k_unique_identity), 0, 0, 1, 1}, {&__pyx_n_s_unique_identity___reduce_cython, __pyx_k_unique_identity___reduce_cython, sizeof(__pyx_k_unique_identity___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_unique_identity___setstate_cyth, __pyx_k_unique_identity___setstate_cyth, sizeof(__pyx_k_unique_identity___setstate_cyth), 0, 0, 1, 1}, {&__pyx_n_s_unique_key, __pyx_k_unique_key, sizeof(__pyx_k_unique_key), 0, 0, 1, 1}, {&__pyx_n_s_unique_key___reduce_cython, __pyx_k_unique_key___reduce_cython, sizeof(__pyx_k_unique_key___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_unique_key___setstate_cython, __pyx_k_unique_key___setstate_cython, sizeof(__pyx_k_unique_key___setstate_cython), 0, 0, 1, 1}, {&__pyx_kp_u_unique_line_423, __pyx_k_unique_line_423, sizeof(__pyx_k_unique_line_423), 0, 1, 0, 0}, {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1}, {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1}, {&__pyx_n_s_val2, __pyx_k_val2, sizeof(__pyx_k_val2), 0, 0, 1, 1}, {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1}, {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, {&__pyx_n_s_zip_longest, __pyx_k_zip_longest, sizeof(__pyx_k_zip_longest), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 615, __pyx_L1_error) __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 615, __pyx_L1_error) __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 615, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 155, __pyx_L1_error) __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 182, __pyx_L1_error) __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 529, __pyx_L1_error) __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 662, __pyx_L1_error) __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(0, 1680, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__6); __Pyx_GIVEREF(__pyx_tuple__6); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__8); __Pyx_GIVEREF(__pyx_tuple__8); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__9); __Pyx_GIVEREF(__pyx_tuple__9); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__10); __Pyx_GIVEREF(__pyx_tuple__10); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__11); __Pyx_GIVEREF(__pyx_tuple__11); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__13); __Pyx_GIVEREF(__pyx_tuple__13); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); /* "cytoolz/itertoolz.pyx":529 * """ * if n < 0: * raise ValueError('n argument for drop() must be non-negative') # <<<<<<<<<<<<<< * cdef Py_ssize_t i * cdef object iter_seq */ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_n_argument_for_drop_must_be_non); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__15); __Pyx_GIVEREF(__pyx_tuple__15); /* "cytoolz/itertoolz.pyx":583 * return seq[n] * if n < 0: * raise ValueError('"n" must be positive when indexing an iterator') # <<<<<<<<<<<<<< * seq = iter(seq) * while n > 0: */ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_n_must_be_positive_when_indexin); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__18); __Pyx_GIVEREF(__pyx_tuple__18); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__22); __Pyx_GIVEREF(__pyx_tuple__22); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__24); __Pyx_GIVEREF(__pyx_tuple__24); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__26); __Pyx_GIVEREF(__pyx_tuple__26); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__28); __Pyx_GIVEREF(__pyx_tuple__28); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__30); __Pyx_GIVEREF(__pyx_tuple__30); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__33); __Pyx_GIVEREF(__pyx_tuple__33); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__36); __Pyx_GIVEREF(__pyx_tuple__36); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__39); __Pyx_GIVEREF(__pyx_tuple__39); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__40); __Pyx_GIVEREF(__pyx_tuple__40); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__41); __Pyx_GIVEREF(__pyx_tuple__41); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__42); __Pyx_GIVEREF(__pyx_tuple__42); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__43); __Pyx_GIVEREF(__pyx_tuple__43); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__44); __Pyx_GIVEREF(__pyx_tuple__44); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__45); __Pyx_GIVEREF(__pyx_tuple__45); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__46); __Pyx_GIVEREF(__pyx_tuple__46); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__47); __Pyx_GIVEREF(__pyx_tuple__47); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__48); __Pyx_GIVEREF(__pyx_tuple__48); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__49); __Pyx_GIVEREF(__pyx_tuple__49); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__50); __Pyx_GIVEREF(__pyx_tuple__50); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__51); __Pyx_GIVEREF(__pyx_tuple__51); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__52); __Pyx_GIVEREF(__pyx_tuple__52); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__53); __Pyx_GIVEREF(__pyx_tuple__53); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__54); __Pyx_GIVEREF(__pyx_tuple__54); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__55); __Pyx_GIVEREF(__pyx_tuple__55); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__56); __Pyx_GIVEREF(__pyx_tuple__56); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__57); __Pyx_GIVEREF(__pyx_tuple__57); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__58); __Pyx_GIVEREF(__pyx_tuple__58); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__59); __Pyx_GIVEREF(__pyx_tuple__59); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__60); __Pyx_GIVEREF(__pyx_tuple__60); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__61); __Pyx_GIVEREF(__pyx_tuple__61); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__62); __Pyx_GIVEREF(__pyx_tuple__62); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__63); __Pyx_GIVEREF(__pyx_tuple__63); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__64); __Pyx_GIVEREF(__pyx_tuple__64); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__65); __Pyx_GIVEREF(__pyx_tuple__65); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__66); __Pyx_GIVEREF(__pyx_tuple__66); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__67); __Pyx_GIVEREF(__pyx_tuple__67); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__68); __Pyx_GIVEREF(__pyx_tuple__68); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__69); __Pyx_GIVEREF(__pyx_tuple__69); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__70); __Pyx_GIVEREF(__pyx_tuple__70); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__71); __Pyx_GIVEREF(__pyx_tuple__71); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__72); __Pyx_GIVEREF(__pyx_tuple__72); /* "cytoolz/itertoolz.pyx":1567 * self.N = len(seqs) * if self.N < 2: * raise TypeError('Too few sequences given (min 2 required)') # <<<<<<<<<<<<<< * if default == no_default: * self.iters = zip(*seqs) */ __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_Too_few_sequences_given_min_2_re); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 1567, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__74); __Pyx_GIVEREF(__pyx_tuple__74); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__75); __Pyx_GIVEREF(__pyx_tuple__75); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__76); __Pyx_GIVEREF(__pyx_tuple__76); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__78); __Pyx_GIVEREF(__pyx_tuple__78); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__79); __Pyx_GIVEREF(__pyx_tuple__79); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(1, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__81); __Pyx_GIVEREF(__pyx_tuple__81); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__82); __Pyx_GIVEREF(__pyx_tuple__82); /* "cytoolz/itertoolz.pyx":30 * * * cpdef object identity(object x): # <<<<<<<<<<<<<< * return x * */ __pyx_tuple__83 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__83); __Pyx_GIVEREF(__pyx_tuple__83); __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_identity, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 30, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__85 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__85); __Pyx_GIVEREF(__pyx_tuple__85); __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__87 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__87); __Pyx_GIVEREF(__pyx_tuple__87); __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__89 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__89); __Pyx_GIVEREF(__pyx_tuple__89); __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__91 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__91); __Pyx_GIVEREF(__pyx_tuple__91); __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(1, 3, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":118 * * * cpdef dict groupby(object key, object seq): # <<<<<<<<<<<<<< * """ * Group a collection by a key function */ __pyx_tuple__93 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_seq); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__93); __Pyx_GIVEREF(__pyx_tuple__93); __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_groupby, 118, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 118, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__95 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__95); __Pyx_GIVEREF(__pyx_tuple__95); __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__97 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__97); __Pyx_GIVEREF(__pyx_tuple__97); __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__99 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__99); __Pyx_GIVEREF(__pyx_tuple__99); __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__101 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__101); __Pyx_GIVEREF(__pyx_tuple__101); __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(1, 3, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":295 * * * def merge_sorted(*seqs, **kwargs): # <<<<<<<<<<<<<< * """ * Merge and sort a collection of sorted collections */ __pyx_tuple__103 = PyTuple_Pack(2, __pyx_n_s_seqs, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__103); __Pyx_GIVEREF(__pyx_tuple__103); __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_merge_sorted_2, 295, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(0, 295, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__105 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__105); __Pyx_GIVEREF(__pyx_tuple__105); __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__107 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__107); __Pyx_GIVEREF(__pyx_tuple__107); __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__109 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__109); __Pyx_GIVEREF(__pyx_tuple__109); __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__111 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__111); __Pyx_GIVEREF(__pyx_tuple__111); __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__113 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__113); __Pyx_GIVEREF(__pyx_tuple__113); __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__115 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__115); __Pyx_GIVEREF(__pyx_tuple__115); __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(1, 3, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":423 * * * cpdef object unique(object seq, object key=None): # <<<<<<<<<<<<<< * """ * Return only unique elements of a sequence */ __pyx_tuple__117 = PyTuple_Pack(2, __pyx_n_s_seq, __pyx_n_s_key); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__117); __Pyx_GIVEREF(__pyx_tuple__117); __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_unique, 423, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(0, 423, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":443 * * * cpdef object isiterable(object x): # <<<<<<<<<<<<<< * """ * Is x iterable? */ __pyx_tuple__119 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__119); __Pyx_GIVEREF(__pyx_tuple__119); __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_isiterable, 443, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(0, 443, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":462 * * * cpdef object isdistinct(object seq): # <<<<<<<<<<<<<< * """ * All values in sequence are distinct */ __pyx_tuple__121 = PyTuple_Pack(1, __pyx_n_s_seq); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__121); __Pyx_GIVEREF(__pyx_tuple__121); __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_isdistinct, 462, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(0, 462, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":487 * * * cpdef object take(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * The first n elements of a sequence */ __pyx_tuple__123 = PyTuple_Pack(2, __pyx_n_s_n, __pyx_n_s_seq); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__123); __Pyx_GIVEREF(__pyx_tuple__123); __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_take, 487, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) __PYX_ERR(0, 487, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":501 * * * cpdef object tail(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * The last n elements of a sequence */ __pyx_tuple__125 = PyTuple_Pack(2, __pyx_n_s_n, __pyx_n_s_seq); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__125); __Pyx_GIVEREF(__pyx_tuple__125); __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_tail, 501, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(0, 501, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":517 * * * cpdef object drop(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * The sequence following the first n elements */ __pyx_tuple__127 = PyTuple_Pack(2, __pyx_n_s_n, __pyx_n_s_seq); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__127); __Pyx_GIVEREF(__pyx_tuple__127); __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_drop, 517, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(0, 517, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":541 * * * cpdef object take_nth(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * Every nth item in seq */ __pyx_tuple__129 = PyTuple_Pack(2, __pyx_n_s_n, __pyx_n_s_seq); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__129); __Pyx_GIVEREF(__pyx_tuple__129); __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_take_nth, 541, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) __PYX_ERR(0, 541, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":551 * * * cpdef object first(object seq): # <<<<<<<<<<<<<< * """ * The first element in a sequence */ __pyx_tuple__131 = PyTuple_Pack(1, __pyx_n_s_seq); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__131); __Pyx_GIVEREF(__pyx_tuple__131); __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_first, 551, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) __PYX_ERR(0, 551, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":561 * * * cpdef object second(object seq): # <<<<<<<<<<<<<< * """ * The second element in a sequence */ __pyx_tuple__133 = PyTuple_Pack(1, __pyx_n_s_seq); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__133); __Pyx_GIVEREF(__pyx_tuple__133); __pyx_codeobj__134 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_second, 561, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) __PYX_ERR(0, 561, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":573 * * * cpdef object nth(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * The nth element in a sequence */ __pyx_tuple__135 = PyTuple_Pack(2, __pyx_n_s_n, __pyx_n_s_seq); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__135); __Pyx_GIVEREF(__pyx_tuple__135); __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_nth, 573, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 573, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":591 * * * cpdef object last(object seq): # <<<<<<<<<<<<<< * """ * The last element in a sequence */ __pyx_tuple__137 = PyTuple_Pack(1, __pyx_n_s_seq); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__137); __Pyx_GIVEREF(__pyx_tuple__137); __pyx_codeobj__138 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_last, 591, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__138)) __PYX_ERR(0, 591, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":609 * * * cpdef object rest(object seq): # <<<<<<<<<<<<<< * seq = iter(seq) * next(seq) */ __pyx_tuple__139 = PyTuple_Pack(1, __pyx_n_s_seq); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__139); __Pyx_GIVEREF(__pyx_tuple__139); __pyx_codeobj__140 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__139, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_rest, 609, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__140)) __PYX_ERR(0, 609, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":615 * * * cdef tuple _get_exceptions = (IndexError, KeyError, TypeError) # <<<<<<<<<<<<<< * cdef tuple _get_list_exc = (IndexError, KeyError) * */ __pyx_tuple__141 = PyTuple_Pack(3, __pyx_builtin_IndexError, __pyx_builtin_KeyError, __pyx_builtin_TypeError); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(0, 615, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__141); __Pyx_GIVEREF(__pyx_tuple__141); /* "cytoolz/itertoolz.pyx":616 * * cdef tuple _get_exceptions = (IndexError, KeyError, TypeError) * cdef tuple _get_list_exc = (IndexError, KeyError) # <<<<<<<<<<<<<< * * */ __pyx_tuple__142 = PyTuple_Pack(2, __pyx_builtin_IndexError, __pyx_builtin_KeyError); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(0, 616, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__142); __Pyx_GIVEREF(__pyx_tuple__142); /* "cytoolz/itertoolz.pyx":619 * * * cpdef object get(object ind, object seq, object default='__no__default__'): # <<<<<<<<<<<<<< * """ * Get element in a sequence or dict */ __pyx_tuple__143 = PyTuple_Pack(3, __pyx_n_s_ind, __pyx_n_s_seq, __pyx_n_s_default); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__143); __Pyx_GIVEREF(__pyx_tuple__143); __pyx_codeobj__144 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__143, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_get, 619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__144)) __PYX_ERR(0, 619, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":697 * * * cpdef object concat(object seqs): # <<<<<<<<<<<<<< * """ * Concatenate zero or more iterables, any of which may be infinite. */ __pyx_tuple__145 = PyTuple_Pack(1, __pyx_n_s_seqs); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__145); __Pyx_GIVEREF(__pyx_tuple__145); __pyx_codeobj__146 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_concat, 697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) __PYX_ERR(0, 697, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":716 * * * def concatv(*seqs): # <<<<<<<<<<<<<< * """ * Variadic version of concat */ __pyx_tuple__147 = PyTuple_Pack(1, __pyx_n_s_seqs); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__147); __Pyx_GIVEREF(__pyx_tuple__147); __pyx_codeobj__148 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_concatv, 716, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__148)) __PYX_ERR(0, 716, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":729 * * * cpdef object mapcat(object func, object seqs): # <<<<<<<<<<<<<< * """ * Apply func to each sequence in seqs, concatenating results. */ __pyx_tuple__149 = PyTuple_Pack(2, __pyx_n_s_func, __pyx_n_s_seqs); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__149); __Pyx_GIVEREF(__pyx_tuple__149); __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_mapcat, 729, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) __PYX_ERR(0, 729, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":740 * * * cpdef object cons(object el, object seq): # <<<<<<<<<<<<<< * """ * Add el to beginning of (possibly infinite) sequence seq. */ __pyx_tuple__151 = PyTuple_Pack(2, __pyx_n_s_el, __pyx_n_s_seq); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__151); __Pyx_GIVEREF(__pyx_tuple__151); __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__151, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_cons, 740, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) __PYX_ERR(0, 740, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__153 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__153); __Pyx_GIVEREF(__pyx_tuple__153); __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__155 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__155); __Pyx_GIVEREF(__pyx_tuple__155); __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) __PYX_ERR(1, 3, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":780 * * * cpdef dict frequencies(object seq): # <<<<<<<<<<<<<< * """ * Find number of occurrences of each value in seq */ __pyx_tuple__157 = PyTuple_Pack(1, __pyx_n_s_seq); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__157); __Pyx_GIVEREF(__pyx_tuple__157); __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_frequencies, 780, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) __PYX_ERR(0, 780, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":817 * * * cpdef dict reduceby(object key, object binop, object seq, object init='__no__default__'): # <<<<<<<<<<<<<< * """ * Perform a simultaneous groupby and reduction */ __pyx_tuple__159 = PyTuple_Pack(4, __pyx_n_s_key, __pyx_n_s_binop, __pyx_n_s_seq, __pyx_n_s_init); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__159); __Pyx_GIVEREF(__pyx_tuple__159); __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_reduceby, 817, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) __PYX_ERR(0, 817, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__161 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__161); __Pyx_GIVEREF(__pyx_tuple__161); __pyx_codeobj__162 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__161, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__162)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__163 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__163); __Pyx_GIVEREF(__pyx_tuple__163); __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__165 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__165); __Pyx_GIVEREF(__pyx_tuple__165); __pyx_codeobj__166 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__166)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__167 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__167); __Pyx_GIVEREF(__pyx_tuple__167); __pyx_codeobj__168 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__168)) __PYX_ERR(1, 3, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":995 * * * cpdef object partition(Py_ssize_t n, object seq, object pad='__no__pad__'): # <<<<<<<<<<<<<< * """ * Partition sequence into tuples of length n */ __pyx_tuple__169 = PyTuple_Pack(3, __pyx_n_s_n, __pyx_n_s_seq, __pyx_n_s_pad); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__169); __Pyx_GIVEREF(__pyx_tuple__169); __pyx_codeobj__170 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_partition, 995, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__170)) __PYX_ERR(0, 995, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__171 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__171); __Pyx_GIVEREF(__pyx_tuple__171); __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__173 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__173); __Pyx_GIVEREF(__pyx_tuple__173); __pyx_codeobj__174 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) __PYX_ERR(1, 3, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":1061 * * * cpdef object count(object seq): # <<<<<<<<<<<<<< * """ * Count the number of items in seq */ __pyx_tuple__175 = PyTuple_Pack(1, __pyx_n_s_seq); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__175); __Pyx_GIVEREF(__pyx_tuple__175); __pyx_codeobj__176 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__175, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_count, 1061, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__176)) __PYX_ERR(0, 1061, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__177 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__177); __Pyx_GIVEREF(__pyx_tuple__177); __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__179 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__179); __Pyx_GIVEREF(__pyx_tuple__179); __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__181 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__181); __Pyx_GIVEREF(__pyx_tuple__181); __pyx_codeobj__182 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__182)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__183 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__183); __Pyx_GIVEREF(__pyx_tuple__183); __pyx_codeobj__184 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__183, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__185 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__185); __Pyx_GIVEREF(__pyx_tuple__185); __pyx_codeobj__186 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__185, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__186)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__187 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__187); __Pyx_GIVEREF(__pyx_tuple__187); __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__187, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__189 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__189); __Pyx_GIVEREF(__pyx_tuple__189); __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__191 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__191); __Pyx_GIVEREF(__pyx_tuple__191); __pyx_codeobj__192 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__191, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__192)) __PYX_ERR(1, 3, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":1171 * * * cpdef object pluck(object ind, object seqs, object default='__no__default__'): # <<<<<<<<<<<<<< * """ * plucks an element or several elements from each item in a sequence. */ __pyx_tuple__193 = PyTuple_Pack(3, __pyx_n_s_ind, __pyx_n_s_seqs, __pyx_n_s_default); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(0, 1171, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__193); __Pyx_GIVEREF(__pyx_tuple__193); __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_pluck, 1171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) __PYX_ERR(0, 1171, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__195 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__195); __Pyx_GIVEREF(__pyx_tuple__195); __pyx_codeobj__196 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__195, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__197 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__197); __Pyx_GIVEREF(__pyx_tuple__197); __pyx_codeobj__198 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__197, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__198)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__199 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__199); __Pyx_GIVEREF(__pyx_tuple__199); __pyx_codeobj__200 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__199, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__201 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__201); __Pyx_GIVEREF(__pyx_tuple__201); __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_tuple__203 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__203); __Pyx_GIVEREF(__pyx_tuple__203); __pyx_codeobj__204 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__203, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__204)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":16 * else: * return __pyx_unpickle__getter_null, (type(self), 0xd41d8cd, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle__getter_null__set_state(self, __pyx_state) */ __pyx_tuple__205 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__205)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__205); __Pyx_GIVEREF(__pyx_tuple__205); __pyx_codeobj__206 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__205, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__206)) __PYX_ERR(1, 16, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":1237 * * # TODO: benchmark getters (and compare against itemgetter) * cpdef object getter(object index): # <<<<<<<<<<<<<< * if isinstance(index, list): * if PyList_GET_SIZE(index) == 0: */ __pyx_tuple__207 = PyTuple_Pack(1, __pyx_n_s_index); if (unlikely(!__pyx_tuple__207)) __PYX_ERR(0, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__207); __Pyx_GIVEREF(__pyx_tuple__207); __pyx_codeobj__208 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__207, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_getter, 1237, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__208)) __PYX_ERR(0, 1237, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":1247 * * * cpdef object join(object leftkey, object leftseq, # <<<<<<<<<<<<<< * object rightkey, object rightseq, * object left_default='__no__default__', */ __pyx_tuple__209 = PyTuple_Pack(6, __pyx_n_s_leftkey, __pyx_n_s_leftseq, __pyx_n_s_rightkey, __pyx_n_s_rightseq, __pyx_n_s_left_default, __pyx_n_s_right_default); if (unlikely(!__pyx_tuple__209)) __PYX_ERR(0, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__209); __Pyx_GIVEREF(__pyx_tuple__209); __pyx_codeobj__210 = (PyObject*)__Pyx_PyCode_New(6, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__209, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_join_2, 1247, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__210)) __PYX_ERR(0, 1247, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__211 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__211)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__211); __Pyx_GIVEREF(__pyx_tuple__211); __pyx_codeobj__212 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__211, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__212)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__213 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__213)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__213); __Pyx_GIVEREF(__pyx_tuple__213); __pyx_codeobj__214 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__213, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__214)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__215 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__215); __Pyx_GIVEREF(__pyx_tuple__215); __pyx_codeobj__216 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__215, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__216)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__217 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__217)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__217); __Pyx_GIVEREF(__pyx_tuple__217); __pyx_codeobj__218 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__217, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__218)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__219 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__219)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__219); __Pyx_GIVEREF(__pyx_tuple__219); __pyx_codeobj__220 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__219, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__220)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__221 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__221)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__221); __Pyx_GIVEREF(__pyx_tuple__221); __pyx_codeobj__222 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__221, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__222)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__223 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__223)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__223); __Pyx_GIVEREF(__pyx_tuple__223); __pyx_codeobj__224 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__223, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__224)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__225 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__225)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__225); __Pyx_GIVEREF(__pyx_tuple__225); __pyx_codeobj__226 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__225, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__226)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__227 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__227)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__227); __Pyx_GIVEREF(__pyx_tuple__227); __pyx_codeobj__228 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__227, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__228)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__229 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__229); __Pyx_GIVEREF(__pyx_tuple__229); __pyx_codeobj__230 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__229, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__230)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__231 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__231); __Pyx_GIVEREF(__pyx_tuple__231); __pyx_codeobj__232 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__231, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__232)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__233 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__233); __Pyx_GIVEREF(__pyx_tuple__233); __pyx_codeobj__234 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__233, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__234)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__235 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__235); __Pyx_GIVEREF(__pyx_tuple__235); __pyx_codeobj__236 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__235, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__236)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__237 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__237)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__237); __Pyx_GIVEREF(__pyx_tuple__237); __pyx_codeobj__238 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__237, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__238)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__239 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__239)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__239); __Pyx_GIVEREF(__pyx_tuple__239); __pyx_codeobj__240 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__239, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__241 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__241)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__241); __Pyx_GIVEREF(__pyx_tuple__241); __pyx_codeobj__242 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__241, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__242)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__243 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__243); __Pyx_GIVEREF(__pyx_tuple__243); __pyx_codeobj__244 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__243, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__244)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__245 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__245)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__245); __Pyx_GIVEREF(__pyx_tuple__245); __pyx_codeobj__246 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__245, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__246)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__247 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__247); __Pyx_GIVEREF(__pyx_tuple__247); __pyx_codeobj__248 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__247, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__248)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__249 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__249)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__249); __Pyx_GIVEREF(__pyx_tuple__249); __pyx_codeobj__250 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__249, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__250)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__251 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__251)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__251); __Pyx_GIVEREF(__pyx_tuple__251); __pyx_codeobj__252 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__251, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__252)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__253 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__253)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__253); __Pyx_GIVEREF(__pyx_tuple__253); __pyx_codeobj__254 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__253, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__254)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__255 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__255)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__255); __Pyx_GIVEREF(__pyx_tuple__255); __pyx_codeobj__256 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__255, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__256)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__257 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__257)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__257); __Pyx_GIVEREF(__pyx_tuple__257); __pyx_codeobj__258 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__257, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__258)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__259 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__259)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__259); __Pyx_GIVEREF(__pyx_tuple__259); __pyx_codeobj__260 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__259, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__260)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__261 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__261)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__261); __Pyx_GIVEREF(__pyx_tuple__261); __pyx_codeobj__262 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__261, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__262)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__263 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__263)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__263); __Pyx_GIVEREF(__pyx_tuple__263); __pyx_codeobj__264 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__263, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__264)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__265 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__265)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__265); __Pyx_GIVEREF(__pyx_tuple__265); __pyx_codeobj__266 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__265, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__266)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__267 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__267)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__267); __Pyx_GIVEREF(__pyx_tuple__267); __pyx_codeobj__268 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__267, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__268)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__269 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__269)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__269); __Pyx_GIVEREF(__pyx_tuple__269); __pyx_codeobj__270 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__269, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__270)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__271 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__271)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__271); __Pyx_GIVEREF(__pyx_tuple__271); __pyx_codeobj__272 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__271, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__272)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__273 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__273)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__273); __Pyx_GIVEREF(__pyx_tuple__273); __pyx_codeobj__274 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__273, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__274)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__275 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__275)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__275); __Pyx_GIVEREF(__pyx_tuple__275); __pyx_codeobj__276 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__275, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__276)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__277 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__277)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__277); __Pyx_GIVEREF(__pyx_tuple__277); __pyx_codeobj__278 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__277, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__278)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__279 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__279)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__279); __Pyx_GIVEREF(__pyx_tuple__279); __pyx_codeobj__280 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__279, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__280)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__281 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__281)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__281); __Pyx_GIVEREF(__pyx_tuple__281); __pyx_codeobj__282 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__281, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__282)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__283 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__283)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__283); __Pyx_GIVEREF(__pyx_tuple__283); __pyx_codeobj__284 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__283, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__284)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__285 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__285)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__285); __Pyx_GIVEREF(__pyx_tuple__285); __pyx_codeobj__286 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__285, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__286)) __PYX_ERR(1, 3, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":1620 * * * def diff(*seqs, **kwargs): # <<<<<<<<<<<<<< * """ * Return those items that differ between sequences */ __pyx_tuple__287 = PyTuple_Pack(5, __pyx_n_s_seqs, __pyx_n_s_kwargs, __pyx_n_s_N, __pyx_n_s_default, __pyx_n_s_key); if (unlikely(!__pyx_tuple__287)) __PYX_ERR(0, 1620, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__287); __Pyx_GIVEREF(__pyx_tuple__287); __pyx_codeobj__288 = (PyObject*)__Pyx_PyCode_New(0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__287, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_diff, 1620, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__288)) __PYX_ERR(0, 1620, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":1646 * * * cpdef object topk(Py_ssize_t k, object seq, object key=None): # <<<<<<<<<<<<<< * """ * Find the k largest elements of a sequence */ __pyx_tuple__289 = PyTuple_Pack(3, __pyx_n_s_k, __pyx_n_s_seq, __pyx_n_s_key); if (unlikely(!__pyx_tuple__289)) __PYX_ERR(0, 1646, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__289); __Pyx_GIVEREF(__pyx_tuple__289); __pyx_codeobj__290 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__289, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_topk, 1646, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__290)) __PYX_ERR(0, 1646, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":1718 * * * cpdef object peek(object seq): # <<<<<<<<<<<<<< * """ * Retrieve the next element of a sequence */ __pyx_tuple__291 = PyTuple_Pack(1, __pyx_n_s_seq); if (unlikely(!__pyx_tuple__291)) __PYX_ERR(0, 1718, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__291); __Pyx_GIVEREF(__pyx_tuple__291); __pyx_codeobj__292 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__291, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_peek, 1718, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__292)) __PYX_ERR(0, 1718, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":1737 * * * cpdef object peekn(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * Retrieve the next n elements of a sequence */ __pyx_tuple__293 = PyTuple_Pack(2, __pyx_n_s_n, __pyx_n_s_seq); if (unlikely(!__pyx_tuple__293)) __PYX_ERR(0, 1737, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__293); __Pyx_GIVEREF(__pyx_tuple__293); __pyx_codeobj__294 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__293, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_itertoolz_pyx, __pyx_n_s_peekn, 1737, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__294)) __PYX_ERR(0, 1737, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__295 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__295)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__295); __Pyx_GIVEREF(__pyx_tuple__295); __pyx_codeobj__296 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__295, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__296)) __PYX_ERR(1, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__297 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__297)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__297); __Pyx_GIVEREF(__pyx_tuple__297); __pyx_codeobj__298 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__297, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__298)) __PYX_ERR(1, 3, __pyx_L1_error) /* "(tree fragment)":1 * def __pyx_unpickle__getter_null(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_tuple__299 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__299)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__299); __Pyx_GIVEREF(__pyx_tuple__299); __pyx_codeobj__300 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__299, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle__getter_null, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__300)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type; if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_222419149 = PyInt_FromLong(222419149L); if (unlikely(!__pyx_int_222419149)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __pyx_v_7cytoolz_9itertoolz__get_exceptions = ((PyObject*)Py_None); Py_INCREF(Py_None); __pyx_v_7cytoolz_9itertoolz__get_list_exc = ((PyObject*)Py_None); Py_INCREF(Py_None); __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ if (__Pyx_ExportFunction("groupby", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_groupby, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("c_merge_sorted", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_c_merge_sorted, "PyObject *(PyObject *, struct __pyx_opt_args_7cytoolz_9itertoolz_c_merge_sorted *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("unique", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_unique, "PyObject *(PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_unique *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("isiterable", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_isiterable, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("isdistinct", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_isdistinct, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("take", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_take, "PyObject *(Py_ssize_t, PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("tail", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_tail, "PyObject *(Py_ssize_t, PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("drop", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_drop, "PyObject *(Py_ssize_t, PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("take_nth", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_take_nth, "PyObject *(Py_ssize_t, PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("first", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_first, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("second", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_second, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("nth", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_nth, "PyObject *(Py_ssize_t, PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("last", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_last, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("rest", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_rest, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("get", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_get, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_get *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("cons", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_cons, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("concat", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_concat, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("mapcat", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_mapcat, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("frequencies", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_frequencies, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("reduceby", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_reduceby, "PyObject *(PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_reduceby *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("partition", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_partition, "PyObject *(Py_ssize_t, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_partition *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("count", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_count, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("pluck", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_pluck, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_pluck *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("getter", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_getter, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("join", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_join, "PyObject *(PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_join *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("c_diff", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_c_diff, "PyObject *(PyObject *, struct __pyx_opt_args_7cytoolz_9itertoolz_c_diff *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("topk", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_topk, "PyObject *(Py_ssize_t, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_topk *__pyx_optional_args)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("peek", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_peek, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (__Pyx_ExportFunction("peekn", (void (*)(void))__pyx_f_7cytoolz_9itertoolz_peekn, "PyObject *(Py_ssize_t, PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz_remove) < 0) __PYX_ERR(0, 34, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz_remove.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz_remove.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz_remove.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz_remove.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_remove, (PyObject *)&__pyx_type_7cytoolz_9itertoolz_remove) < 0) __PYX_ERR(0, 34, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz_remove) < 0) __PYX_ERR(0, 34, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz_remove = &__pyx_type_7cytoolz_9itertoolz_remove; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz_accumulate) < 0) __PYX_ERR(0, 59, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz_accumulate.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz_accumulate.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz_accumulate.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz_accumulate.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_accumulate, (PyObject *)&__pyx_type_7cytoolz_9itertoolz_accumulate) < 0) __PYX_ERR(0, 59, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz_accumulate) < 0) __PYX_ERR(0, 59, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz_accumulate = &__pyx_type_7cytoolz_9itertoolz_accumulate; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__merge_sorted) < 0) __PYX_ERR(0, 187, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__merge_sorted.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__merge_sorted.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__merge_sorted.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__merge_sorted.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_merge_sorted, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__merge_sorted) < 0) __PYX_ERR(0, 187, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__merge_sorted) < 0) __PYX_ERR(0, 187, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__merge_sorted = &__pyx_type_7cytoolz_9itertoolz__merge_sorted; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__merge_sorted_key) < 0) __PYX_ERR(0, 243, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__merge_sorted_key.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__merge_sorted_key.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__merge_sorted_key.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__merge_sorted_key.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_merge_sorted_key, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__merge_sorted_key) < 0) __PYX_ERR(0, 243, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__merge_sorted_key) < 0) __PYX_ERR(0, 243, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__merge_sorted_key = &__pyx_type_7cytoolz_9itertoolz__merge_sorted_key; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz_interleave) < 0) __PYX_ERR(0, 317, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz_interleave.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz_interleave.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz_interleave.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz_interleave.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_interleave, (PyObject *)&__pyx_type_7cytoolz_9itertoolz_interleave) < 0) __PYX_ERR(0, 317, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz_interleave) < 0) __PYX_ERR(0, 317, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz_interleave = &__pyx_type_7cytoolz_9itertoolz_interleave; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__unique_key) < 0) __PYX_ERR(0, 386, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__unique_key.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__unique_key.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__unique_key.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__unique_key.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_unique_key, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__unique_key) < 0) __PYX_ERR(0, 386, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__unique_key) < 0) __PYX_ERR(0, 386, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__unique_key = &__pyx_type_7cytoolz_9itertoolz__unique_key; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__unique_identity) < 0) __PYX_ERR(0, 406, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__unique_identity.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__unique_identity.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__unique_identity.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__unique_identity.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_unique_identity, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__unique_identity) < 0) __PYX_ERR(0, 406, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__unique_identity) < 0) __PYX_ERR(0, 406, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__unique_identity = &__pyx_type_7cytoolz_9itertoolz__unique_identity; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz_interpose) < 0) __PYX_ERR(0, 750, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz_interpose.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz_interpose.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz_interpose.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz_interpose.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_interpose, (PyObject *)&__pyx_type_7cytoolz_9itertoolz_interpose) < 0) __PYX_ERR(0, 750, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz_interpose) < 0) __PYX_ERR(0, 750, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz_interpose = &__pyx_type_7cytoolz_9itertoolz_interpose; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz_iterate) < 0) __PYX_ERR(0, 905, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz_iterate.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz_iterate.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz_iterate.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz_iterate.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_iterate, (PyObject *)&__pyx_type_7cytoolz_9itertoolz_iterate) < 0) __PYX_ERR(0, 905, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz_iterate) < 0) __PYX_ERR(0, 905, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz_iterate = &__pyx_type_7cytoolz_9itertoolz_iterate; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz_sliding_window) < 0) __PYX_ERR(0, 948, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz_sliding_window.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz_sliding_window.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz_sliding_window.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz_sliding_window.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_sliding_window, (PyObject *)&__pyx_type_7cytoolz_9itertoolz_sliding_window) < 0) __PYX_ERR(0, 948, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz_sliding_window) < 0) __PYX_ERR(0, 948, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz_sliding_window = &__pyx_type_7cytoolz_9itertoolz_sliding_window; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz_partition_all) < 0) __PYX_ERR(0, 1021, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz_partition_all.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz_partition_all.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz_partition_all.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz_partition_all.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_partition_all, (PyObject *)&__pyx_type_7cytoolz_9itertoolz_partition_all) < 0) __PYX_ERR(0, 1021, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz_partition_all) < 0) __PYX_ERR(0, 1021, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz_partition_all = &__pyx_type_7cytoolz_9itertoolz_partition_all; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__pluck_index) < 0) __PYX_ERR(0, 1080, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__pluck_index.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__pluck_index.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__pluck_index.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__pluck_index.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_pluck_index, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__pluck_index) < 0) __PYX_ERR(0, 1080, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__pluck_index) < 0) __PYX_ERR(0, 1080, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__pluck_index = &__pyx_type_7cytoolz_9itertoolz__pluck_index; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__pluck_index_default) < 0) __PYX_ERR(0, 1093, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__pluck_index_default.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__pluck_index_default.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__pluck_index_default.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__pluck_index_default.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_pluck_index_default, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__pluck_index_default) < 0) __PYX_ERR(0, 1093, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__pluck_index_default) < 0) __PYX_ERR(0, 1093, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__pluck_index_default = &__pyx_type_7cytoolz_9itertoolz__pluck_index_default; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__pluck_list) < 0) __PYX_ERR(0, 1118, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__pluck_list.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__pluck_list.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__pluck_list.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__pluck_list.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_pluck_list, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__pluck_list) < 0) __PYX_ERR(0, 1118, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__pluck_list) < 0) __PYX_ERR(0, 1118, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__pluck_list = &__pyx_type_7cytoolz_9itertoolz__pluck_list; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__pluck_list_default) < 0) __PYX_ERR(0, 1140, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__pluck_list_default.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__pluck_list_default.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__pluck_list_default.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__pluck_list_default.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_pluck_list_default, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__pluck_list_default) < 0) __PYX_ERR(0, 1140, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__pluck_list_default) < 0) __PYX_ERR(0, 1140, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__pluck_list_default = &__pyx_type_7cytoolz_9itertoolz__pluck_list_default; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__getter_index) < 0) __PYX_ERR(0, 1206, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__getter_index.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__getter_index.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__getter_index.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__getter_index.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_getter_index, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__getter_index) < 0) __PYX_ERR(0, 1206, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__getter_index) < 0) __PYX_ERR(0, 1206, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__getter_index = &__pyx_type_7cytoolz_9itertoolz__getter_index; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__getter_list) < 0) __PYX_ERR(0, 1214, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__getter_list.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__getter_list.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__getter_list.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__getter_list.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_getter_list, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__getter_list) < 0) __PYX_ERR(0, 1214, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__getter_list) < 0) __PYX_ERR(0, 1214, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__getter_list = &__pyx_type_7cytoolz_9itertoolz__getter_list; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__getter_null) < 0) __PYX_ERR(0, 1231, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__getter_null.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__getter_null.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__getter_null.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__getter_null.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_getter_null, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__getter_null) < 0) __PYX_ERR(0, 1231, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__getter_null) < 0) __PYX_ERR(0, 1231, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__getter_null = &__pyx_type_7cytoolz_9itertoolz__getter_null; __pyx_vtabptr_7cytoolz_9itertoolz__join = &__pyx_vtable_7cytoolz_9itertoolz__join; __pyx_vtable_7cytoolz_9itertoolz__join.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_5_join_rightkey; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__join) < 0) __PYX_ERR(0, 1350, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__join.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__join.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__join.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__join.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__join.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__join) < 0) __PYX_ERR(0, 1350, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_join, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__join) < 0) __PYX_ERR(0, 1350, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__join) < 0) __PYX_ERR(0, 1350, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__join = &__pyx_type_7cytoolz_9itertoolz__join; __pyx_vtabptr_7cytoolz_9itertoolz__inner_join = &__pyx_vtable_7cytoolz_9itertoolz__inner_join; __pyx_vtable_7cytoolz_9itertoolz__inner_join.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__join; __pyx_type_7cytoolz_9itertoolz__inner_join.tp_base = __pyx_ptype_7cytoolz_9itertoolz__join; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__inner_join) < 0) __PYX_ERR(0, 1527, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__inner_join.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__inner_join.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__inner_join.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__inner_join.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__inner_join.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__inner_join) < 0) __PYX_ERR(0, 1527, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_inner_join, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__inner_join) < 0) __PYX_ERR(0, 1527, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__inner_join) < 0) __PYX_ERR(0, 1527, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__inner_join = &__pyx_type_7cytoolz_9itertoolz__inner_join; __pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join = &__pyx_vtable_7cytoolz_9itertoolz__right_outer_join; __pyx_vtable_7cytoolz_9itertoolz__right_outer_join.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__join; __pyx_type_7cytoolz_9itertoolz__right_outer_join.tp_base = __pyx_ptype_7cytoolz_9itertoolz__join; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__right_outer_join) < 0) __PYX_ERR(0, 1378, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__right_outer_join.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__right_outer_join.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__right_outer_join.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__right_outer_join.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__right_outer_join.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join) < 0) __PYX_ERR(0, 1378, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_right_outer_join, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__right_outer_join) < 0) __PYX_ERR(0, 1378, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__right_outer_join) < 0) __PYX_ERR(0, 1378, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__right_outer_join = &__pyx_type_7cytoolz_9itertoolz__right_outer_join; __pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join = &__pyx_vtable_7cytoolz_9itertoolz__left_outer_join; __pyx_vtable_7cytoolz_9itertoolz__left_outer_join.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__join; __pyx_type_7cytoolz_9itertoolz__left_outer_join.tp_base = __pyx_ptype_7cytoolz_9itertoolz__join; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__left_outer_join) < 0) __PYX_ERR(0, 1471, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__left_outer_join.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__left_outer_join.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__left_outer_join.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__left_outer_join.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__left_outer_join.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join) < 0) __PYX_ERR(0, 1471, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_left_outer_join, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__left_outer_join) < 0) __PYX_ERR(0, 1471, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__left_outer_join) < 0) __PYX_ERR(0, 1471, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__left_outer_join = &__pyx_type_7cytoolz_9itertoolz__left_outer_join; __pyx_vtabptr_7cytoolz_9itertoolz__outer_join = &__pyx_vtable_7cytoolz_9itertoolz__outer_join; __pyx_vtable_7cytoolz_9itertoolz__outer_join.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__join; __pyx_type_7cytoolz_9itertoolz__outer_join.tp_base = __pyx_ptype_7cytoolz_9itertoolz__join; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__outer_join) < 0) __PYX_ERR(0, 1415, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__outer_join.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__outer_join.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__outer_join.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__outer_join.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__outer_join.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__outer_join) < 0) __PYX_ERR(0, 1415, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_outer_join, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__outer_join) < 0) __PYX_ERR(0, 1415, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__outer_join) < 0) __PYX_ERR(0, 1415, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__outer_join = &__pyx_type_7cytoolz_9itertoolz__outer_join; __pyx_vtabptr_7cytoolz_9itertoolz__inner_join_key = &__pyx_vtable_7cytoolz_9itertoolz__inner_join_key; __pyx_vtable_7cytoolz_9itertoolz__inner_join_key.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__inner_join; __pyx_vtable_7cytoolz_9itertoolz__inner_join_key.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_15_inner_join_key_rightkey; __pyx_type_7cytoolz_9itertoolz__inner_join_key.tp_base = __pyx_ptype_7cytoolz_9itertoolz__inner_join; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__inner_join_key) < 0) __PYX_ERR(0, 1542, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__inner_join_key.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__inner_join_key.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__inner_join_key.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__inner_join_key.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__inner_join_key.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__inner_join_key) < 0) __PYX_ERR(0, 1542, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_inner_join_key, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__inner_join_key) < 0) __PYX_ERR(0, 1542, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__inner_join_key) < 0) __PYX_ERR(0, 1542, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__inner_join_key = &__pyx_type_7cytoolz_9itertoolz__inner_join_key; __pyx_vtabptr_7cytoolz_9itertoolz__inner_join_index = &__pyx_vtable_7cytoolz_9itertoolz__inner_join_index; __pyx_vtable_7cytoolz_9itertoolz__inner_join_index.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__inner_join; __pyx_vtable_7cytoolz_9itertoolz__inner_join_index.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_17_inner_join_index_rightkey; __pyx_type_7cytoolz_9itertoolz__inner_join_index.tp_base = __pyx_ptype_7cytoolz_9itertoolz__inner_join; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__inner_join_index) < 0) __PYX_ERR(0, 1547, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__inner_join_index.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__inner_join_index.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__inner_join_index.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__inner_join_index.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__inner_join_index.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__inner_join_index) < 0) __PYX_ERR(0, 1547, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_inner_join_index, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__inner_join_index) < 0) __PYX_ERR(0, 1547, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__inner_join_index) < 0) __PYX_ERR(0, 1547, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__inner_join_index = &__pyx_type_7cytoolz_9itertoolz__inner_join_index; __pyx_vtabptr_7cytoolz_9itertoolz__inner_join_indices = &__pyx_vtable_7cytoolz_9itertoolz__inner_join_indices; __pyx_vtable_7cytoolz_9itertoolz__inner_join_indices.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__inner_join; __pyx_vtable_7cytoolz_9itertoolz__inner_join_indices.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_19_inner_join_indices_rightkey; __pyx_type_7cytoolz_9itertoolz__inner_join_indices.tp_base = __pyx_ptype_7cytoolz_9itertoolz__inner_join; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__inner_join_indices) < 0) __PYX_ERR(0, 1552, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__inner_join_indices.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__inner_join_indices.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__inner_join_indices.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__inner_join_indices.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__inner_join_indices.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__inner_join_indices) < 0) __PYX_ERR(0, 1552, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_inner_join_indices, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__inner_join_indices) < 0) __PYX_ERR(0, 1552, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__inner_join_indices) < 0) __PYX_ERR(0, 1552, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__inner_join_indices = &__pyx_type_7cytoolz_9itertoolz__inner_join_indices; __pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_key = &__pyx_vtable_7cytoolz_9itertoolz__right_outer_join_key; __pyx_vtable_7cytoolz_9itertoolz__right_outer_join_key.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join; __pyx_vtable_7cytoolz_9itertoolz__right_outer_join_key.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_21_right_outer_join_key_rightkey; __pyx_type_7cytoolz_9itertoolz__right_outer_join_key.tp_base = __pyx_ptype_7cytoolz_9itertoolz__right_outer_join; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__right_outer_join_key) < 0) __PYX_ERR(0, 1394, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__right_outer_join_key.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__right_outer_join_key.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__right_outer_join_key.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__right_outer_join_key.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__right_outer_join_key.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_key) < 0) __PYX_ERR(0, 1394, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_right_outer_join_key, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__right_outer_join_key) < 0) __PYX_ERR(0, 1394, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__right_outer_join_key) < 0) __PYX_ERR(0, 1394, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__right_outer_join_key = &__pyx_type_7cytoolz_9itertoolz__right_outer_join_key; __pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_index = &__pyx_vtable_7cytoolz_9itertoolz__right_outer_join_index; __pyx_vtable_7cytoolz_9itertoolz__right_outer_join_index.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join; __pyx_vtable_7cytoolz_9itertoolz__right_outer_join_index.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_23_right_outer_join_index_rightkey; __pyx_type_7cytoolz_9itertoolz__right_outer_join_index.tp_base = __pyx_ptype_7cytoolz_9itertoolz__right_outer_join; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__right_outer_join_index) < 0) __PYX_ERR(0, 1399, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__right_outer_join_index.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__right_outer_join_index.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__right_outer_join_index.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__right_outer_join_index.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__right_outer_join_index.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_index) < 0) __PYX_ERR(0, 1399, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_right_outer_join_index, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__right_outer_join_index) < 0) __PYX_ERR(0, 1399, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__right_outer_join_index) < 0) __PYX_ERR(0, 1399, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__right_outer_join_index = &__pyx_type_7cytoolz_9itertoolz__right_outer_join_index; __pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_indices = &__pyx_vtable_7cytoolz_9itertoolz__right_outer_join_indices; __pyx_vtable_7cytoolz_9itertoolz__right_outer_join_indices.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join; __pyx_vtable_7cytoolz_9itertoolz__right_outer_join_indices.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_25_right_outer_join_indices_rightkey; __pyx_type_7cytoolz_9itertoolz__right_outer_join_indices.tp_base = __pyx_ptype_7cytoolz_9itertoolz__right_outer_join; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__right_outer_join_indices) < 0) __PYX_ERR(0, 1404, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__right_outer_join_indices.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__right_outer_join_indices.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__right_outer_join_indices.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__right_outer_join_indices.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__right_outer_join_indices.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_indices) < 0) __PYX_ERR(0, 1404, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_right_outer_join_indices, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__right_outer_join_indices) < 0) __PYX_ERR(0, 1404, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__right_outer_join_indices) < 0) __PYX_ERR(0, 1404, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__right_outer_join_indices = &__pyx_type_7cytoolz_9itertoolz__right_outer_join_indices; __pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_key = &__pyx_vtable_7cytoolz_9itertoolz__left_outer_join_key; __pyx_vtable_7cytoolz_9itertoolz__left_outer_join_key.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join; __pyx_vtable_7cytoolz_9itertoolz__left_outer_join_key.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_20_left_outer_join_key_rightkey; __pyx_type_7cytoolz_9itertoolz__left_outer_join_key.tp_base = __pyx_ptype_7cytoolz_9itertoolz__left_outer_join; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__left_outer_join_key) < 0) __PYX_ERR(0, 1506, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__left_outer_join_key.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__left_outer_join_key.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__left_outer_join_key.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__left_outer_join_key.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__left_outer_join_key.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_key) < 0) __PYX_ERR(0, 1506, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_left_outer_join_key, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__left_outer_join_key) < 0) __PYX_ERR(0, 1506, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__left_outer_join_key) < 0) __PYX_ERR(0, 1506, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__left_outer_join_key = &__pyx_type_7cytoolz_9itertoolz__left_outer_join_key; __pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_index = &__pyx_vtable_7cytoolz_9itertoolz__left_outer_join_index; __pyx_vtable_7cytoolz_9itertoolz__left_outer_join_index.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join; __pyx_vtable_7cytoolz_9itertoolz__left_outer_join_index.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_22_left_outer_join_index_rightkey; __pyx_type_7cytoolz_9itertoolz__left_outer_join_index.tp_base = __pyx_ptype_7cytoolz_9itertoolz__left_outer_join; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__left_outer_join_index) < 0) __PYX_ERR(0, 1511, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__left_outer_join_index.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__left_outer_join_index.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__left_outer_join_index.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__left_outer_join_index.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__left_outer_join_index.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_index) < 0) __PYX_ERR(0, 1511, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_left_outer_join_index, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__left_outer_join_index) < 0) __PYX_ERR(0, 1511, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__left_outer_join_index) < 0) __PYX_ERR(0, 1511, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__left_outer_join_index = &__pyx_type_7cytoolz_9itertoolz__left_outer_join_index; __pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_indices = &__pyx_vtable_7cytoolz_9itertoolz__left_outer_join_indices; __pyx_vtable_7cytoolz_9itertoolz__left_outer_join_indices.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join; __pyx_vtable_7cytoolz_9itertoolz__left_outer_join_indices.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_24_left_outer_join_indices_rightkey; __pyx_type_7cytoolz_9itertoolz__left_outer_join_indices.tp_base = __pyx_ptype_7cytoolz_9itertoolz__left_outer_join; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__left_outer_join_indices) < 0) __PYX_ERR(0, 1516, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__left_outer_join_indices.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__left_outer_join_indices.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__left_outer_join_indices.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__left_outer_join_indices.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__left_outer_join_indices.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_indices) < 0) __PYX_ERR(0, 1516, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_left_outer_join_indices, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__left_outer_join_indices) < 0) __PYX_ERR(0, 1516, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__left_outer_join_indices) < 0) __PYX_ERR(0, 1516, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__left_outer_join_indices = &__pyx_type_7cytoolz_9itertoolz__left_outer_join_indices; __pyx_vtabptr_7cytoolz_9itertoolz__outer_join_key = &__pyx_vtable_7cytoolz_9itertoolz__outer_join_key; __pyx_vtable_7cytoolz_9itertoolz__outer_join_key.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__outer_join; __pyx_vtable_7cytoolz_9itertoolz__outer_join_key.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_15_outer_join_key_rightkey; __pyx_type_7cytoolz_9itertoolz__outer_join_key.tp_base = __pyx_ptype_7cytoolz_9itertoolz__outer_join; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__outer_join_key) < 0) __PYX_ERR(0, 1450, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__outer_join_key.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__outer_join_key.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__outer_join_key.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__outer_join_key.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__outer_join_key.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__outer_join_key) < 0) __PYX_ERR(0, 1450, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_outer_join_key, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__outer_join_key) < 0) __PYX_ERR(0, 1450, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__outer_join_key) < 0) __PYX_ERR(0, 1450, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__outer_join_key = &__pyx_type_7cytoolz_9itertoolz__outer_join_key; __pyx_vtabptr_7cytoolz_9itertoolz__outer_join_index = &__pyx_vtable_7cytoolz_9itertoolz__outer_join_index; __pyx_vtable_7cytoolz_9itertoolz__outer_join_index.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__outer_join; __pyx_vtable_7cytoolz_9itertoolz__outer_join_index.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_17_outer_join_index_rightkey; __pyx_type_7cytoolz_9itertoolz__outer_join_index.tp_base = __pyx_ptype_7cytoolz_9itertoolz__outer_join; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__outer_join_index) < 0) __PYX_ERR(0, 1455, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__outer_join_index.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__outer_join_index.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__outer_join_index.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__outer_join_index.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__outer_join_index.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__outer_join_index) < 0) __PYX_ERR(0, 1455, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_outer_join_index, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__outer_join_index) < 0) __PYX_ERR(0, 1455, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__outer_join_index) < 0) __PYX_ERR(0, 1455, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__outer_join_index = &__pyx_type_7cytoolz_9itertoolz__outer_join_index; __pyx_vtabptr_7cytoolz_9itertoolz__outer_join_indices = &__pyx_vtable_7cytoolz_9itertoolz__outer_join_indices; __pyx_vtable_7cytoolz_9itertoolz__outer_join_indices.__pyx_base = *__pyx_vtabptr_7cytoolz_9itertoolz__outer_join; __pyx_vtable_7cytoolz_9itertoolz__outer_join_indices.__pyx_base.__pyx_base.rightkey = (PyObject *(*)(struct __pyx_obj_7cytoolz_9itertoolz__join *))__pyx_f_7cytoolz_9itertoolz_19_outer_join_indices_rightkey; __pyx_type_7cytoolz_9itertoolz__outer_join_indices.tp_base = __pyx_ptype_7cytoolz_9itertoolz__outer_join; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__outer_join_indices) < 0) __PYX_ERR(0, 1460, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__outer_join_indices.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__outer_join_indices.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__outer_join_indices.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__outer_join_indices.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (__Pyx_SetVtable(__pyx_type_7cytoolz_9itertoolz__outer_join_indices.tp_dict, __pyx_vtabptr_7cytoolz_9itertoolz__outer_join_indices) < 0) __PYX_ERR(0, 1460, __pyx_L1_error) if (PyObject_SetAttr(__pyx_m, __pyx_n_s_outer_join_indices, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__outer_join_indices) < 0) __PYX_ERR(0, 1460, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__outer_join_indices) < 0) __PYX_ERR(0, 1460, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__outer_join_indices = &__pyx_type_7cytoolz_9itertoolz__outer_join_indices; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__diff_key) < 0) __PYX_ERR(0, 1563, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__diff_key.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__diff_key.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__diff_key.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__diff_key.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_diff_key, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__diff_key) < 0) __PYX_ERR(0, 1563, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__diff_key) < 0) __PYX_ERR(0, 1563, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__diff_key = &__pyx_type_7cytoolz_9itertoolz__diff_key; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz__diff_identity) < 0) __PYX_ERR(0, 1588, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz__diff_identity.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz__diff_identity.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz__diff_identity.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz__diff_identity.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_diff_identity, (PyObject *)&__pyx_type_7cytoolz_9itertoolz__diff_identity) < 0) __PYX_ERR(0, 1588, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz__diff_identity) < 0) __PYX_ERR(0, 1588, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__diff_identity = &__pyx_type_7cytoolz_9itertoolz__diff_identity; if (PyType_Ready(&__pyx_type_7cytoolz_9itertoolz_random_sample) < 0) __PYX_ERR(0, 1756, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_9itertoolz_random_sample.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_9itertoolz_random_sample.tp_dictoffset && __pyx_type_7cytoolz_9itertoolz_random_sample.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_9itertoolz_random_sample.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_random_sample, (PyObject *)&__pyx_type_7cytoolz_9itertoolz_random_sample) < 0) __PYX_ERR(0, 1756, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_9itertoolz_random_sample) < 0) __PYX_ERR(0, 1756, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz_random_sample = &__pyx_type_7cytoolz_9itertoolz_random_sample; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), #else sizeof(PyHeapTypeObject), #endif __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION < 3 #ifdef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC void #else #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #endif #else #ifdef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyObject * #else #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC inititertoolz(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC inititertoolz(void) #else __Pyx_PyMODINIT_FUNC PyInit_itertoolz(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_itertoolz(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { result = PyDict_SetItemString(moddict, to_name, value); } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_itertoolz(PyObject *__pyx_pyinit_module) #endif #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'itertoolz' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif #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("__Pyx_PyMODINIT_FUNC PyInit_itertoolz(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __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 CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("itertoolz", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __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_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_cytoolz__itertoolz) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "cytoolz.itertoolz")) { if (unlikely(PyDict_SetItemString(modules, "cytoolz.itertoolz", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error; /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error; /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "cytoolz/itertoolz.pyx":13 * from cytoolz.cpython cimport PtrIter_Next, PtrObject_GetItem * * from collections import deque # <<<<<<<<<<<<<< * from heapq import heapify, heappop, heapreplace * from itertools import chain, islice */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_deque); __Pyx_GIVEREF(__pyx_n_s_deque); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_deque); __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __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_deque); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_deque, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":14 * * from collections import deque * from heapq import heapify, heappop, heapreplace # <<<<<<<<<<<<<< * from itertools import chain, islice * from operator import itemgetter */ __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_heapify); __Pyx_GIVEREF(__pyx_n_s_heapify); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_heapify); __Pyx_INCREF(__pyx_n_s_heappop); __Pyx_GIVEREF(__pyx_n_s_heappop); PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_heappop); __Pyx_INCREF(__pyx_n_s_heapreplace); __Pyx_GIVEREF(__pyx_n_s_heapreplace); PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_heapreplace); __pyx_t_1 = __Pyx_Import(__pyx_n_s_heapq, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __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_heapify); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_heapify, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_heappop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_heappop, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_heapreplace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_heapreplace, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":15 * from collections import deque * from heapq import heapify, heappop, heapreplace * from itertools import chain, islice # <<<<<<<<<<<<<< * from operator import itemgetter * from random import Random */ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_chain); __Pyx_GIVEREF(__pyx_n_s_chain); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_chain); __Pyx_INCREF(__pyx_n_s_islice); __Pyx_GIVEREF(__pyx_n_s_islice); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_islice); __pyx_t_2 = __Pyx_Import(__pyx_n_s_itertools, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __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_chain); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_chain, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_islice); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_islice, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":16 * from heapq import heapify, heappop, heapreplace * from itertools import chain, islice * from operator import itemgetter # <<<<<<<<<<<<<< * from random import Random * from cytoolz.compatibility import map, zip, zip_longest */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_itemgetter); __Pyx_GIVEREF(__pyx_n_s_itemgetter); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_itemgetter); __pyx_t_1 = __Pyx_Import(__pyx_n_s_operator, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __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_itemgetter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_itemgetter, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":17 * from itertools import chain, islice * from operator import itemgetter * from random import Random # <<<<<<<<<<<<<< * from cytoolz.compatibility import map, zip, zip_longest * from cytoolz.utils import no_default */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_Random); __Pyx_GIVEREF(__pyx_n_s_Random); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Random); __pyx_t_2 = __Pyx_Import(__pyx_n_s_random, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __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_Random); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Random, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":18 * from operator import itemgetter * from random import Random * from cytoolz.compatibility import map, zip, zip_longest # <<<<<<<<<<<<<< * from cytoolz.utils import no_default * */ __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_map); __Pyx_GIVEREF(__pyx_n_s_map); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_map); __Pyx_INCREF(__pyx_n_s_zip); __Pyx_GIVEREF(__pyx_n_s_zip); PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_zip); __Pyx_INCREF(__pyx_n_s_zip_longest); __Pyx_GIVEREF(__pyx_n_s_zip_longest); PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_zip_longest); __pyx_t_1 = __Pyx_Import(__pyx_n_s_cytoolz_compatibility, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __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_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_map, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_zip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_zip, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_zip_longest); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_zip_longest, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/itertoolz.pyx":19 * from random import Random * from cytoolz.compatibility import map, zip, zip_longest * from cytoolz.utils import no_default # <<<<<<<<<<<<<< * * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_no_default); __Pyx_GIVEREF(__pyx_n_s_no_default); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_no_default); __pyx_t_2 = __Pyx_Import(__pyx_n_s_cytoolz_utils, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __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_no_default); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_no_default, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":22 * * * __all__ = ['remove', 'accumulate', 'groupby', 'merge_sorted', 'interleave', # <<<<<<<<<<<<<< * 'unique', 'isiterable', 'isdistinct', 'take', 'drop', 'take_nth', * 'first', 'second', 'nth', 'last', 'get', 'concat', 'concatv', */ __pyx_t_2 = PyList_New(36); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_remove); __Pyx_GIVEREF(__pyx_n_s_remove); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_remove); __Pyx_INCREF(__pyx_n_s_accumulate); __Pyx_GIVEREF(__pyx_n_s_accumulate); PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_accumulate); __Pyx_INCREF(__pyx_n_s_groupby); __Pyx_GIVEREF(__pyx_n_s_groupby); PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_groupby); __Pyx_INCREF(__pyx_n_s_merge_sorted_2); __Pyx_GIVEREF(__pyx_n_s_merge_sorted_2); PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_merge_sorted_2); __Pyx_INCREF(__pyx_n_s_interleave); __Pyx_GIVEREF(__pyx_n_s_interleave); PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_interleave); __Pyx_INCREF(__pyx_n_s_unique); __Pyx_GIVEREF(__pyx_n_s_unique); PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_s_unique); __Pyx_INCREF(__pyx_n_s_isiterable); __Pyx_GIVEREF(__pyx_n_s_isiterable); PyList_SET_ITEM(__pyx_t_2, 6, __pyx_n_s_isiterable); __Pyx_INCREF(__pyx_n_s_isdistinct); __Pyx_GIVEREF(__pyx_n_s_isdistinct); PyList_SET_ITEM(__pyx_t_2, 7, __pyx_n_s_isdistinct); __Pyx_INCREF(__pyx_n_s_take); __Pyx_GIVEREF(__pyx_n_s_take); PyList_SET_ITEM(__pyx_t_2, 8, __pyx_n_s_take); __Pyx_INCREF(__pyx_n_s_drop); __Pyx_GIVEREF(__pyx_n_s_drop); PyList_SET_ITEM(__pyx_t_2, 9, __pyx_n_s_drop); __Pyx_INCREF(__pyx_n_s_take_nth); __Pyx_GIVEREF(__pyx_n_s_take_nth); PyList_SET_ITEM(__pyx_t_2, 10, __pyx_n_s_take_nth); __Pyx_INCREF(__pyx_n_s_first); __Pyx_GIVEREF(__pyx_n_s_first); PyList_SET_ITEM(__pyx_t_2, 11, __pyx_n_s_first); __Pyx_INCREF(__pyx_n_s_second); __Pyx_GIVEREF(__pyx_n_s_second); PyList_SET_ITEM(__pyx_t_2, 12, __pyx_n_s_second); __Pyx_INCREF(__pyx_n_s_nth); __Pyx_GIVEREF(__pyx_n_s_nth); PyList_SET_ITEM(__pyx_t_2, 13, __pyx_n_s_nth); __Pyx_INCREF(__pyx_n_s_last); __Pyx_GIVEREF(__pyx_n_s_last); PyList_SET_ITEM(__pyx_t_2, 14, __pyx_n_s_last); __Pyx_INCREF(__pyx_n_s_get); __Pyx_GIVEREF(__pyx_n_s_get); PyList_SET_ITEM(__pyx_t_2, 15, __pyx_n_s_get); __Pyx_INCREF(__pyx_n_s_concat); __Pyx_GIVEREF(__pyx_n_s_concat); PyList_SET_ITEM(__pyx_t_2, 16, __pyx_n_s_concat); __Pyx_INCREF(__pyx_n_s_concatv); __Pyx_GIVEREF(__pyx_n_s_concatv); PyList_SET_ITEM(__pyx_t_2, 17, __pyx_n_s_concatv); __Pyx_INCREF(__pyx_n_s_mapcat); __Pyx_GIVEREF(__pyx_n_s_mapcat); PyList_SET_ITEM(__pyx_t_2, 18, __pyx_n_s_mapcat); __Pyx_INCREF(__pyx_n_s_cons); __Pyx_GIVEREF(__pyx_n_s_cons); PyList_SET_ITEM(__pyx_t_2, 19, __pyx_n_s_cons); __Pyx_INCREF(__pyx_n_s_interpose); __Pyx_GIVEREF(__pyx_n_s_interpose); PyList_SET_ITEM(__pyx_t_2, 20, __pyx_n_s_interpose); __Pyx_INCREF(__pyx_n_s_frequencies); __Pyx_GIVEREF(__pyx_n_s_frequencies); PyList_SET_ITEM(__pyx_t_2, 21, __pyx_n_s_frequencies); __Pyx_INCREF(__pyx_n_s_reduceby); __Pyx_GIVEREF(__pyx_n_s_reduceby); PyList_SET_ITEM(__pyx_t_2, 22, __pyx_n_s_reduceby); __Pyx_INCREF(__pyx_n_s_iterate); __Pyx_GIVEREF(__pyx_n_s_iterate); PyList_SET_ITEM(__pyx_t_2, 23, __pyx_n_s_iterate); __Pyx_INCREF(__pyx_n_s_sliding_window); __Pyx_GIVEREF(__pyx_n_s_sliding_window); PyList_SET_ITEM(__pyx_t_2, 24, __pyx_n_s_sliding_window); __Pyx_INCREF(__pyx_n_s_partition); __Pyx_GIVEREF(__pyx_n_s_partition); PyList_SET_ITEM(__pyx_t_2, 25, __pyx_n_s_partition); __Pyx_INCREF(__pyx_n_s_partition_all); __Pyx_GIVEREF(__pyx_n_s_partition_all); PyList_SET_ITEM(__pyx_t_2, 26, __pyx_n_s_partition_all); __Pyx_INCREF(__pyx_n_s_count); __Pyx_GIVEREF(__pyx_n_s_count); PyList_SET_ITEM(__pyx_t_2, 27, __pyx_n_s_count); __Pyx_INCREF(__pyx_n_s_pluck); __Pyx_GIVEREF(__pyx_n_s_pluck); PyList_SET_ITEM(__pyx_t_2, 28, __pyx_n_s_pluck); __Pyx_INCREF(__pyx_n_s_join_2); __Pyx_GIVEREF(__pyx_n_s_join_2); PyList_SET_ITEM(__pyx_t_2, 29, __pyx_n_s_join_2); __Pyx_INCREF(__pyx_n_s_tail); __Pyx_GIVEREF(__pyx_n_s_tail); PyList_SET_ITEM(__pyx_t_2, 30, __pyx_n_s_tail); __Pyx_INCREF(__pyx_n_s_diff); __Pyx_GIVEREF(__pyx_n_s_diff); PyList_SET_ITEM(__pyx_t_2, 31, __pyx_n_s_diff); __Pyx_INCREF(__pyx_n_s_topk); __Pyx_GIVEREF(__pyx_n_s_topk); PyList_SET_ITEM(__pyx_t_2, 32, __pyx_n_s_topk); __Pyx_INCREF(__pyx_n_s_peek); __Pyx_GIVEREF(__pyx_n_s_peek); PyList_SET_ITEM(__pyx_t_2, 33, __pyx_n_s_peek); __Pyx_INCREF(__pyx_n_s_peekn); __Pyx_GIVEREF(__pyx_n_s_peekn); PyList_SET_ITEM(__pyx_t_2, 34, __pyx_n_s_peekn); __Pyx_INCREF(__pyx_n_s_random_sample); __Pyx_GIVEREF(__pyx_n_s_random_sample); PyList_SET_ITEM(__pyx_t_2, 35, __pyx_n_s_random_sample); if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":30 * * * cpdef object identity(object x): # <<<<<<<<<<<<<< * return x * */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_1identity, 0, __pyx_n_s_identity, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_identity, __pyx_t_2) < 0) __PYX_ERR(0, 30, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_6remove_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_remove___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_6remove_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_remove___setstate_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_10accumulate_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_accumulate___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_10accumulate_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_accumulate___setstate_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":118 * * * cpdef dict groupby(object key, object seq): # <<<<<<<<<<<<<< * """ * Group a collection by a key function */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_3groupby, 0, __pyx_n_s_groupby, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__94)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby, __pyx_t_2) < 0) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_13_merge_sorted_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_merge_sorted___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_13_merge_sorted_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_merge_sorted___setstate_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_17_merge_sorted_key_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_merge_sorted_key___reduce_cytho, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_17_merge_sorted_key_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_merge_sorted_key___setstate_cyt, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":295 * * * def merge_sorted(*seqs, **kwargs): # <<<<<<<<<<<<<< * """ * Merge and sort a collection of sorted collections */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_5merge_sorted, 0, __pyx_n_s_merge_sorted_2, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_merge_sorted_2, __pyx_t_2) < 0) __PYX_ERR(0, 295, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_10interleave_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_interleave___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_10interleave_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_interleave___setstate_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_11_unique_key_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_unique_key___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_11_unique_key_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_unique_key___setstate_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_16_unique_identity_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_unique_identity___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_16_unique_identity_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_unique_identity___setstate_cyth, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":423 * * * cpdef object unique(object seq, object key=None): # <<<<<<<<<<<<<< * """ * Return only unique elements of a sequence */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_7unique, 0, __pyx_n_s_unique, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_unique, __pyx_t_2) < 0) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":443 * * * cpdef object isiterable(object x): # <<<<<<<<<<<<<< * """ * Is x iterable? */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_9isiterable, 0, __pyx_n_s_isiterable, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_isiterable, __pyx_t_2) < 0) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":462 * * * cpdef object isdistinct(object seq): # <<<<<<<<<<<<<< * """ * All values in sequence are distinct */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_11isdistinct, 0, __pyx_n_s_isdistinct, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_isdistinct, __pyx_t_2) < 0) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":487 * * * cpdef object take(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * The first n elements of a sequence */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_13take, 0, __pyx_n_s_take, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_take, __pyx_t_2) < 0) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":501 * * * cpdef object tail(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * The last n elements of a sequence */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_15tail, 0, __pyx_n_s_tail, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_tail, __pyx_t_2) < 0) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":517 * * * cpdef object drop(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * The sequence following the first n elements */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_17drop, 0, __pyx_n_s_drop, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_drop, __pyx_t_2) < 0) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":541 * * * cpdef object take_nth(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * Every nth item in seq */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_19take_nth, 0, __pyx_n_s_take_nth, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_take_nth, __pyx_t_2) < 0) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":551 * * * cpdef object first(object seq): # <<<<<<<<<<<<<< * """ * The first element in a sequence */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_21first, 0, __pyx_n_s_first, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_first, __pyx_t_2) < 0) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":561 * * * cpdef object second(object seq): # <<<<<<<<<<<<<< * """ * The second element in a sequence */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_23second, 0, __pyx_n_s_second, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_second, __pyx_t_2) < 0) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":573 * * * cpdef object nth(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * The nth element in a sequence */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_25nth, 0, __pyx_n_s_nth, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_nth, __pyx_t_2) < 0) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":591 * * * cpdef object last(object seq): # <<<<<<<<<<<<<< * """ * The last element in a sequence */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_27last, 0, __pyx_n_s_last, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__138)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_last, __pyx_t_2) < 0) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":609 * * * cpdef object rest(object seq): # <<<<<<<<<<<<<< * seq = iter(seq) * next(seq) */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_29rest, 0, __pyx_n_s_rest, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__140)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_rest, __pyx_t_2) < 0) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":615 * * * cdef tuple _get_exceptions = (IndexError, KeyError, TypeError) # <<<<<<<<<<<<<< * cdef tuple _get_list_exc = (IndexError, KeyError) * */ __Pyx_INCREF(__pyx_tuple__141); __Pyx_XGOTREF(__pyx_v_7cytoolz_9itertoolz__get_exceptions); __Pyx_DECREF_SET(__pyx_v_7cytoolz_9itertoolz__get_exceptions, __pyx_tuple__141); __Pyx_GIVEREF(__pyx_tuple__141); /* "cytoolz/itertoolz.pyx":616 * * cdef tuple _get_exceptions = (IndexError, KeyError, TypeError) * cdef tuple _get_list_exc = (IndexError, KeyError) # <<<<<<<<<<<<<< * * */ __Pyx_INCREF(__pyx_tuple__142); __Pyx_XGOTREF(__pyx_v_7cytoolz_9itertoolz__get_list_exc); __Pyx_DECREF_SET(__pyx_v_7cytoolz_9itertoolz__get_list_exc, __pyx_tuple__142); __Pyx_GIVEREF(__pyx_tuple__142); /* "cytoolz/itertoolz.pyx":619 * * * cpdef object get(object ind, object seq, object default='__no__default__'): # <<<<<<<<<<<<<< * """ * Get element in a sequence or dict */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_31get, 0, __pyx_n_s_get, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__144)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(0, 619, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":697 * * * cpdef object concat(object seqs): # <<<<<<<<<<<<<< * """ * Concatenate zero or more iterables, any of which may be infinite. */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_33concat, 0, __pyx_n_s_concat, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__146)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_concat, __pyx_t_2) < 0) __PYX_ERR(0, 697, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":716 * * * def concatv(*seqs): # <<<<<<<<<<<<<< * """ * Variadic version of concat */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_35concatv, 0, __pyx_n_s_concatv, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__148)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_concatv, __pyx_t_2) < 0) __PYX_ERR(0, 716, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":729 * * * cpdef object mapcat(object func, object seqs): # <<<<<<<<<<<<<< * """ * Apply func to each sequence in seqs, concatenating results. */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_37mapcat, 0, __pyx_n_s_mapcat, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_mapcat, __pyx_t_2) < 0) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":740 * * * cpdef object cons(object el, object seq): # <<<<<<<<<<<<<< * """ * Add el to beginning of (possibly infinite) sequence seq. */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_39cons, 0, __pyx_n_s_cons, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__152)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_cons, __pyx_t_2) < 0) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_9interpose_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_interpose___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_9interpose_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_interpose___setstate_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":780 * * * cpdef dict frequencies(object seq): # <<<<<<<<<<<<<< * """ * Find number of occurrences of each value in seq */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_41frequencies, 0, __pyx_n_s_frequencies, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_frequencies, __pyx_t_2) < 0) __PYX_ERR(0, 780, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":817 * * * cpdef dict reduceby(object key, object binop, object seq, object init='__no__default__'): # <<<<<<<<<<<<<< * """ * Perform a simultaneous groupby and reduction */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_43reduceby, 0, __pyx_n_s_reduceby, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduceby, __pyx_t_2) < 0) __PYX_ERR(0, 817, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_7iterate_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_iterate___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__162)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_7iterate_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_iterate___setstate_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_14sliding_window_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_sliding_window___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__166)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_14sliding_window_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_sliding_window___setstate_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__168)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":992 * * * no_pad = '__no__pad__' # <<<<<<<<<<<<<< * * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_no_pad, __pyx_n_s_no__pad) < 0) __PYX_ERR(0, 992, __pyx_L1_error) /* "cytoolz/itertoolz.pyx":995 * * * cpdef object partition(Py_ssize_t n, object seq, object pad='__no__pad__'): # <<<<<<<<<<<<<< * """ * Partition sequence into tuples of length n */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_45partition, 0, __pyx_n_s_partition, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__170)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_partition, __pyx_t_2) < 0) __PYX_ERR(0, 995, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_13partition_all_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_partition_all___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_13partition_all_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_partition_all___setstate_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__174)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1061 * * * cpdef object count(object seq): # <<<<<<<<<<<<<< * """ * Count the number of items in seq */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_47count, 0, __pyx_n_s_count, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__176)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_count, __pyx_t_2) < 0) __PYX_ERR(0, 1061, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_12_pluck_index_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pluck_index___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_12_pluck_index_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pluck_index___setstate_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_20_pluck_index_default_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pluck_index_default___reduce_cy, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__182)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_20_pluck_index_default_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pluck_index_default___setstate, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__184)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_11_pluck_list_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pluck_list___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__186)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_11_pluck_list_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pluck_list___setstate_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__188)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_19_pluck_list_default_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pluck_list_default___reduce_cyt, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_19_pluck_list_default_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pluck_list_default___setstate_c, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__192)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1171 * * * cpdef object pluck(object ind, object seqs, object default='__no__default__'): # <<<<<<<<<<<<<< * """ * plucks an element or several elements from each item in a sequence. */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_49pluck, 0, __pyx_n_s_pluck, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pluck, __pyx_t_2) < 0) __PYX_ERR(0, 1171, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_13_getter_index_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_getter_index___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__196)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_13_getter_index_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_getter_index___setstate_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__198)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_12_getter_list_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_getter_list___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__200)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_12_getter_list_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_getter_list___setstate_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__202)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_12_getter_null_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_getter_null___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__204)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":16 * else: * return __pyx_unpickle__getter_null, (type(self), 0xd41d8cd, state) * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle__getter_null__set_state(self, __pyx_state) */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_12_getter_null_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_getter_null___setstate_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__206)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1237 * * # TODO: benchmark getters (and compare against itemgetter) * cpdef object getter(object index): # <<<<<<<<<<<<<< * if isinstance(index, list): * if PyList_GET_SIZE(index) == 0: */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_51getter, 0, __pyx_n_s_getter, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__208)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_getter, __pyx_t_2) < 0) __PYX_ERR(0, 1237, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1247 * * * cpdef object join(object leftkey, object leftseq, # <<<<<<<<<<<<<< * object rightkey, object rightseq, * object left_default='__no__default__', */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_53join, 0, __pyx_n_s_join_2, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__210)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_join_2, __pyx_t_2) < 0) __PYX_ERR(0, 1247, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1354 * object leftkey, object leftseq, * object rightkey, object rightseq, * object left_default=no_default, # <<<<<<<<<<<<<< * object right_default=no_default): * self.left_default = left_default */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_k__37 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1355 * object rightkey, object rightseq, * object left_default=no_default, * object right_default=no_default): # <<<<<<<<<<<<<< * self.left_default = left_default * self.right_default = right_default */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_k__38 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_5_join_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_join___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__212)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_5_join_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_join___setstate_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__214)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_17_right_outer_join_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_right_outer_join___reduce_cytho, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__216)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_17_right_outer_join_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_right_outer_join___setstate_cyt, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__218)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_21_right_outer_join_key_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_right_outer_join_key___reduce_c, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__220)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_21_right_outer_join_key_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_right_outer_join_key___setstate, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__222)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_23_right_outer_join_index_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_right_outer_join_index___reduce, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__224)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_23_right_outer_join_index_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_right_outer_join_index___setsta, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__226)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_25_right_outer_join_indices_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_right_outer_join_indices___redu, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__228)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_25_right_outer_join_indices_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_right_outer_join_indices___sets, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__230)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_11_outer_join_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_outer_join___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__232)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_11_outer_join_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_outer_join___setstate_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__234)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_15_outer_join_key_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_outer_join_key___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__236)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_15_outer_join_key_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_outer_join_key___setstate_cytho, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__238)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_17_outer_join_index_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_outer_join_index___reduce_cytho, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__240)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_17_outer_join_index_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_outer_join_index___setstate_cyt, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__242)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_19_outer_join_indices_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_outer_join_indices___reduce_cyt, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__244)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_19_outer_join_indices_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_outer_join_indices___setstate_c, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__246)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_16_left_outer_join_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_left_outer_join___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_16_left_outer_join_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_left_outer_join___setstate_cyth, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_20_left_outer_join_key_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_left_outer_join_key___reduce_cy, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__252)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_20_left_outer_join_key_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_left_outer_join_key___setstate, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__254)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_22_left_outer_join_index_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_left_outer_join_index___reduce, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__256)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_22_left_outer_join_index_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_left_outer_join_index___setstat, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__258)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_24_left_outer_join_indices_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_left_outer_join_indices___reduc, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__260)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_24_left_outer_join_indices_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_left_outer_join_indices___setst, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__262)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_11_inner_join_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_inner_join___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__264)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_11_inner_join_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_inner_join___setstate_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__266)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_15_inner_join_key_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_inner_join_key___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__268)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_15_inner_join_key_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_inner_join_key___setstate_cytho, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__270)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_17_inner_join_index_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_inner_join_index___reduce_cytho, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__272)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_17_inner_join_index_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_inner_join_index___setstate_cyt, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__274)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_19_inner_join_indices_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_inner_join_indices___reduce_cyt, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__276)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_19_inner_join_indices_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_inner_join_indices___setstate_c, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__278)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1564 * * cdef class _diff_key: * def __cinit__(self, object seqs, object key, object default=no_default): # <<<<<<<<<<<<<< * self.N = len(seqs) * if self.N < 2: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_k__73 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_9_diff_key_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_diff_key___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__280)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_9_diff_key_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_diff_key___setstate_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__282)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1589 * * cdef class _diff_identity: * def __cinit__(self, object seqs, object default=no_default): # <<<<<<<<<<<<<< * self.N = len(seqs) * if self.N < 2: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_k__77 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_14_diff_identity_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_diff_identity___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__284)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_14_diff_identity_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_diff_identity___setstate_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__286)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1613 * * * cdef object c_diff(object seqs, object default=no_default, object key=None): # <<<<<<<<<<<<<< * if key is None: * return _diff_identity(seqs, default=default) */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_no_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_k__80 = __pyx_t_2; __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1620 * * * def diff(*seqs, **kwargs): # <<<<<<<<<<<<<< * """ * Return those items that differ between sequences */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_55diff, 0, __pyx_n_s_diff, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__288)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_diff, __pyx_t_2) < 0) __PYX_ERR(0, 1620, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1646 * * * cpdef object topk(Py_ssize_t k, object seq, object key=None): # <<<<<<<<<<<<<< * """ * Find the k largest elements of a sequence */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_57topk, 0, __pyx_n_s_topk, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__290)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_topk, __pyx_t_2) < 0) __PYX_ERR(0, 1646, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1718 * * * cpdef object peek(object seq): # <<<<<<<<<<<<<< * """ * Retrieve the next element of a sequence */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_59peek, 0, __pyx_n_s_peek, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__292)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_peek, __pyx_t_2) < 0) __PYX_ERR(0, 1718, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1737 * * * cpdef object peekn(Py_ssize_t n, object seq): # <<<<<<<<<<<<<< * """ * Retrieve the next n elements of a sequence */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_61peekn, 0, __pyx_n_s_peekn, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__294)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1737, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_peekn, __pyx_t_2) < 0) __PYX_ERR(0, 1737, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_13random_sample_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_random_sample___reduce_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__296)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_13random_sample_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_random_sample___setstate_cython, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__298)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 * def __pyx_unpickle__getter_null(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_9itertoolz_63__pyx_unpickle__getter_null, 0, __pyx_n_s_pyx_unpickle__getter_null, NULL, __pyx_n_s_cytoolz_itertoolz, __pyx_d, ((PyObject *)__pyx_codeobj__300)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle__getter_null, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/itertoolz.pyx":1 * from cpython.dict cimport PyDict_GetItem, PyDict_SetItem # <<<<<<<<<<<<<< * from cpython.exc cimport PyErr_Clear, PyErr_GivenExceptionMatches, PyErr_Occurred * from cpython.list cimport PyList_Append, PyList_GET_ITEM, PyList_GET_SIZE */ __pyx_t_2 = __Pyx_PyDict_NewPresized(27); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_groupby_line_118, __pyx_kp_u_Group_a_collection_by_a_key_fun) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_merge_sorted_line_295, __pyx_kp_u_Merge_and_sort_a_collection_of) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_unique_line_423, __pyx_kp_u_Return_only_unique_elements_of) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_isiterable_line_443, __pyx_kp_u_Is_x_iterable_isiterable_1_2_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_isdistinct_line_462, __pyx_kp_u_All_values_in_sequence_are_dist) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_take_line_487, __pyx_kp_u_The_first_n_elements_of_a_seque) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_tail_line_501, __pyx_kp_u_The_last_n_elements_of_a_sequen) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_drop_line_517, __pyx_kp_u_The_sequence_following_the_firs) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_take_nth_line_541, __pyx_kp_u_Every_nth_item_in_seq_list_take) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_first_line_551, __pyx_kp_u_The_first_element_in_a_sequence) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_second_line_561, __pyx_kp_u_The_second_element_in_a_sequenc) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_nth_line_573, __pyx_kp_u_The_nth_element_in_a_sequence_n) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_last_line_591, __pyx_kp_u_The_last_element_in_a_sequence) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_get_line_619, __pyx_kp_u_Get_element_in_a_sequence_or_di) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_concat_line_697, __pyx_kp_u_Concatenate_zero_or_more_iterab) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_concatv_line_716, __pyx_kp_u_Variadic_version_of_concat_list) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_mapcat_line_729, __pyx_kp_u_Apply_func_to_each_sequence_in) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_cons_line_740, __pyx_kp_u_Add_el_to_beginning_of_possibly) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_frequencies_line_780, __pyx_kp_u_Find_number_of_occurrences_of_e) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_reduceby_line_817, __pyx_kp_u_Perform_a_simultaneous_groupby) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_partition_line_995, __pyx_kp_u_Partition_sequence_into_tuples) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_pluck_line_1171, __pyx_kp_u_plucks_an_element_or_several_el) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_join_line_1247, __pyx_kp_u_Join_two_sequences_on_common_at) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_diff_line_1620, __pyx_kp_u_Return_those_items_that_differ) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_topk_line_1646, __pyx_kp_u_Find_the_k_largest_elements_of) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_peek_line_1718, __pyx_kp_u_Retrieve_the_next_element_of_a) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_peekn_line_1737, __pyx_kp_u_Retrieve_the_next_n_elements_of) < 0) __PYX_ERR(0, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init cytoolz.itertoolz", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_CLEAR(__pyx_m); } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init cytoolz.itertoolz"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS 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); } #endif /* GetBuiltinName */ 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; } /* RaiseArgTupleInvalid */ 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); } /* RaiseDoubleKeywords */ 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 } /* ParseKeywords */ 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; } /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; 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); } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; } #endif /* IterNext */ static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_Occurred(); if (unlikely(exc_type)) { if (!defval || unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(defval); return defval; } if (defval) { Py_INCREF(defval); return defval; } __Pyx_PyErr_SetNone(PyExc_StopIteration); return NULL; } static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) { PyErr_Format(PyExc_TypeError, "%.200s object is not an iterator", Py_TYPE(iterator)->tp_name); } static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) { PyObject* next; iternextfunc iternext = Py_TYPE(iterator)->tp_iternext; if (likely(iternext)) { #if CYTHON_USE_TYPE_SLOTS next = iternext(iterator); if (likely(next)) return next; #if PY_VERSION_HEX >= 0x02070000 if (unlikely(iternext == &_PyObject_NextNotImplemented)) return NULL; #endif #else next = PyIter_Next(iterator); if (likely(next)) return next; #endif } else if (CYTHON_USE_TYPE_SLOTS || unlikely(!PyIter_Check(iterator))) { __Pyx_PyIter_Next_ErrorNoIterator(iterator); return NULL; } #if !CYTHON_USE_TYPE_SLOTS else { next = PyIter_Next(iterator); if (likely(next)) return next; } #endif return __Pyx_PyIter_Next2Default(defval); } /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { PyCFunctionObject *func = (PyCFunctionObject*)func_obj; PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyObject *self = PyCFunction_GET_SELF(func); int flags = PyCFunction_GET_FLAGS(func); assert(PyCFunction_Check(func)); assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); assert(nargs >= 0); assert(nargs == 0 || args != NULL); /* _PyCFunction_FastCallDict() must not be called with an exception set, because it may clear it (directly or indirectly) and so the caller loses its exception */ assert(!PyErr_Occurred()); if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); } else { return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); } } #endif /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { return NULL; } if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif #endif /* PyObjectCall */ #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 (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCall2Args */ static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args, *result = NULL; #if CYTHON_FAST_PYCALL if (PyFunction_Check(function)) { PyObject *args[2] = {arg1, arg2}; return __Pyx_PyFunction_FastCall(function, args, 2); } #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(function)) { PyObject *args[2] = {arg1, arg2}; return __Pyx_PyCFunction_FastCall(function, args, 2); } #endif args = PyTuple_New(2); if (unlikely(!args)) goto done; Py_INCREF(arg1); PyTuple_SET_ITEM(args, 0, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 1, arg2); Py_INCREF(function); result = __Pyx_PyObject_Call(function, args, NULL); Py_DECREF(args); Py_DECREF(function); done: return result; } /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallOneArg */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif if (likely(PyCFunction_Check(func))) { if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { return __Pyx_PyCFunction_FastCall(func, &arg, 1); #endif } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare 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 (PyType_Check(type)) { #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; 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; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else 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) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } 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 (cause) { 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) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* GetItemInt */ static 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, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_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, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_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, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(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(__Pyx_is_valid_index(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)) return NULL; PyErr_Clear(); } } 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)); } /* ObjectGetItem */ #if CYTHON_USE_TYPE_SLOTS static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { PyObject *runerr; Py_ssize_t key_value; PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; if (unlikely(!(m && m->sq_item))) { PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); return NULL; } key_value = __Pyx_PyIndex_AsSsize_t(index); if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); } if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { PyErr_Clear(); PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); } return NULL; } static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; if (likely(m && m->mp_subscript)) { return m->mp_subscript(obj, key); } return __Pyx_PyObject_GetIndex(obj, key); } #endif /* None */ 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; } /* SliceObject */ 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_USE_TYPE_SLOTS 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)) goto bad; PyErr_Clear(); } } 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_USE_TYPE_SLOTS 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; } /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; #endif Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else 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; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; icurexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; if (unlikely(PyTuple_Check(err))) return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type, *local_value, *local_tb; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; 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_FAST_THREAD_STATE 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_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; } #else 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; #endif 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; } /* KeywordStringCheck */ static 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_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; } /* DictGetItem */ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) { if (unlikely(PyTuple_Check(key))) { PyObject* args = PyTuple_Pack(1, key); if (likely(args)) { PyErr_SetObject(PyExc_KeyError, args); Py_DECREF(args); } } else { PyErr_SetObject(PyExc_KeyError, key); } } return NULL; } Py_INCREF(value); return value; } #endif /* PyObjectCallNoArg */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) #else if (likely(PyCFunction_Check(func))) #endif { if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif /* BytesEquals */ 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; #if CYTHON_USE_UNICODE_INTERNALS Py_hash_t hash1, hash2; hash1 = ((PyBytesObject*)s1)->ob_shash; hash2 = ((PyBytesObject*)s2)->ob_shash; if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { return (equals == Py_NE); } #endif 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 } /* UnicodeEquals */ 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 (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) return -1; length = __Pyx_PyUnicode_GET_LENGTH(s1); if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { goto return_ne; } #if CYTHON_USE_UNICODE_INTERNALS { Py_hash_t hash1, hash2; #if CYTHON_PEP393_ENABLED hash1 = ((PyASCIIObject*)s1)->hash; hash2 = ((PyASCIIObject*)s2)->hash; #else hash1 = ((PyUnicodeObject*)s1)->hash; hash2 = ((PyUnicodeObject*)s2)->hash; #endif if (hash1 != hash2 && hash1 != -1 && hash2 != -1) { goto return_ne; } } #endif 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_MAJOR_VERSION < 3 Py_XDECREF(owned_ref); #endif 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 } /* GetAttr */ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) { #if CYTHON_USE_TYPE_SLOTS #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); } /* HasAttr */ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) { PyObject *r; if (unlikely(!__Pyx_PyBaseString_Check(n))) { PyErr_SetString(PyExc_TypeError, "hasattr(): attribute name must be string"); return -1; } r = __Pyx_GetAttr(o, n); if (unlikely(!r)) { PyErr_Clear(); return 0; } else { Py_DECREF(r); return 1; } } /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { if (unlikely(!type)) { PyErr_SetString(PyExc_SystemError, "Missing type object"); return 0; } else if (exact) { #if PY_MAJOR_VERSION == 2 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; #endif } else { if (likely(__Pyx_TypeCheck(obj, type))) return 1; } PyErr_Format(PyExc_TypeError, "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", name, type->tp_name, Py_TYPE(obj)->tp_name); return 0; } /* GetAttr3 */ static PyObject *__Pyx_GetAttr3Default(PyObject *d) { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(d); return d; } static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) { PyObject *r = __Pyx_GetAttr(o, n); return (likely(r)) ? r : __Pyx_GetAttr3Default(d); } /* pyfrozenset_new */ static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) { if (it) { PyObject* result; #if CYTHON_COMPILING_IN_PYPY PyObject* args; args = PyTuple_Pack(1, it); if (unlikely(!args)) return NULL; result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL); Py_DECREF(args); return result; #else 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); #endif } #if CYTHON_USE_TYPE_SLOTS return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL); #else return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL); #endif } /* PySetContains */ static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) { int result = -1; if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) { PyObject *tmpkey; PyErr_Clear(); tmpkey = __Pyx_PyFrozenSet_New(key); if (tmpkey != NULL) { result = PySet_Contains(set, tmpkey); Py_DECREF(tmpkey); } } return result; } static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) { int result = PySet_Contains(set, key); if (unlikely(result < 0)) { result = __Pyx_PySet_ContainsUnhashable(set, key); } return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } /* UnpackUnboundCMethod */ static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) { PyObject *method; method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name); if (unlikely(!method)) return -1; target->method = method; #if CYTHON_COMPILING_IN_CPYTHON #if PY_MAJOR_VERSION >= 3 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type))) #endif { PyMethodDescrObject *descr = (PyMethodDescrObject*) method; target->func = descr->d_method->ml_meth; target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS); } #endif return 0; } /* CallUnboundCMethod1 */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) { if (likely(cfunc->func)) { int flag = cfunc->flag; if (flag == METH_O) { return (*(cfunc->func))(self, arg); } else if (PY_VERSION_HEX >= 0x030600B1 && flag == METH_FASTCALL) { if (PY_VERSION_HEX >= 0x030700A0) { return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1); } else { return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); } } else if (PY_VERSION_HEX >= 0x030700A0 && flag == (METH_FASTCALL | METH_KEYWORDS)) { return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL); } } return __Pyx__CallUnboundCMethod1(cfunc, self, arg); } #endif static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){ PyObject *args, *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { args = PyTuple_New(1); if (unlikely(!args)) goto bad; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); } else { args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg); PyTuple_SET_ITEM(args, 1, arg); result = __Pyx_PyObject_Call(cfunc->method, args, NULL); } #else args = PyTuple_Pack(2, self, arg); if (unlikely(!args)) goto bad; result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif bad: Py_XDECREF(args); return result; } /* CallUnboundCMethod2 */ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) { if (likely(cfunc->func)) { PyObject *args[2] = {arg1, arg2}; if (cfunc->flag == METH_FASTCALL) { #if PY_VERSION_HEX >= 0x030700A0 return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2); #else return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); #endif } #if PY_VERSION_HEX >= 0x030700A0 if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS)) return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL); #endif } return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2); } #endif static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){ PyObject *args, *result = NULL; if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL; #if CYTHON_COMPILING_IN_CPYTHON if (cfunc->func && (cfunc->flag & METH_VARARGS)) { args = PyTuple_New(2); if (unlikely(!args)) goto bad; Py_INCREF(arg1); PyTuple_SET_ITEM(args, 0, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 1, arg2); if (cfunc->flag & METH_KEYWORDS) result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL); else result = (*cfunc->func)(self, args); } else { args = PyTuple_New(3); if (unlikely(!args)) goto bad; Py_INCREF(self); PyTuple_SET_ITEM(args, 0, self); Py_INCREF(arg1); PyTuple_SET_ITEM(args, 1, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 2, arg2); result = __Pyx_PyObject_Call(cfunc->method, args, NULL); } #else args = PyTuple_Pack(3, self, arg1, arg2); if (unlikely(!args)) goto bad; result = __Pyx_PyObject_Call(cfunc->method, args, NULL); #endif bad: Py_XDECREF(args); return result; } /* dict_getitem_default */ static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) { PyObject* value; #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (unlikely(PyErr_Occurred())) return NULL; value = default_value; } Py_INCREF(value); if ((1)); #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); } #endif else { if (default_value == Py_None) value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key); else value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value); } return value; } /* pyobject_as_double */ static double __Pyx__PyObject_AsDouble(PyObject* obj) { PyObject* float_value; #if !CYTHON_USE_TYPE_SLOTS float_value = PyNumber_Float(obj); if ((0)) goto bad; #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; } /* Import */ 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_MAJOR_VERSION < 3 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_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } /* ImportFrom */ 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; } /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'%.50s' object has no attribute '%U'", tp->tp_name, attr_name); #else "'%.50s' object has no attribute '%.400s'", tp->tp_name, PyString_AS_STRING(attr_name)); #endif return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; #if CYTHON_USE_PYTYPE_LOOKUP if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD; #else if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD; #endif #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD; ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD; setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD; ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD; } PyType_Modified((PyTypeObject*)type_obj); } } goto GOOD; BAD: if (!PyErr_Occurred()) PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); ret = -1; GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } /* SetVTable */ static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 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; } /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif result = PyObject_GetAttrString(module, class_name); 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 ((size_t)basicsize < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* FetchCommonType */ 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; } /* CythonFunction */ #include 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, CYTHON_UNUSED void *context) { PyObject *tmp = op->func_doc; if (value == NULL) { value = Py_None; } Py_INCREF(value); op->func_doc = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 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); #else op->defaults_tuple = PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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} }; static PyMemberDef __pyx_CyFunction_members[] = { {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, 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[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif 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; __Pyx_CyFunction_weakreflist(op) = 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]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); PyObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(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 __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); } if (obj == Py_None) obj = NULL; return __Pyx_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 } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; Py_ssize_t size; switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 0)) return (*meth)(self, NULL); PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d 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 (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d 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; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; argc = PyTuple_GET_SIZE(args); new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, 0, 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_CyFunction_descr_get, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 0, #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, #endif }; static int __pyx_CyFunction_init(void) { __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); if (unlikely(__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 = PyObject_Malloc(size); if (unlikely(!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); } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ 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 - start) / 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); } /* AddTraceback */ #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, 0, 0, 0, 0, __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, __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; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } 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_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 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); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 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(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #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_IntOrLong(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_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 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(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #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_IntOrLong(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_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = a->tp_base; if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; if (!res) { res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } return res; } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x02070000 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; } /* InitStrings */ 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 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; if (PyObject_Hash(*t->p) == -1) 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 const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { 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 *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const 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)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #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 int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type %.200s). " "The ability to return an instance of a strict subclass of int " "is deprecated, and may be removed in a future version of Python.", Py_TYPE(result)->tp_name)) { Py_DECREF(result); return NULL; } return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", type_name, type_name, Py_TYPE(result)->tp_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } 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))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ cytoolz-0.10.1/cytoolz/itertoolz.pxd000066400000000000000000000111271355770264200175640ustar00rootroot00000000000000cdef class remove: cdef object predicate cdef object iter_seq cdef class accumulate: cdef object binop cdef object iter_seq cdef object result cdef object initial cpdef dict groupby(object key, object seq) cdef class _merge_sorted: cdef object seq1 cdef object seq2 cdef object val1 cdef object val2 cdef Py_ssize_t loop cdef class _merge_sorted_key: cdef object seq1 cdef object seq2 cdef object val1 cdef object val2 cdef object key cdef object key1 cdef object key2 cdef Py_ssize_t loop cdef object c_merge_sorted(object seqs, object key=*) cdef class interleave: cdef list iters cdef list newiters cdef Py_ssize_t i cdef Py_ssize_t n cdef class _unique_key: cdef object key cdef object iter_seq cdef object seen cdef class _unique_identity: cdef object iter_seq cdef object seen cpdef object unique(object seq, object key=*) cpdef object isiterable(object x) cpdef object isdistinct(object seq) cpdef object take(Py_ssize_t n, object seq) cpdef object tail(Py_ssize_t n, object seq) cpdef object drop(Py_ssize_t n, object seq) cpdef object take_nth(Py_ssize_t n, object seq) cpdef object first(object seq) cpdef object second(object seq) cpdef object nth(Py_ssize_t n, object seq) cpdef object last(object seq) cpdef object rest(object seq) cpdef object get(object ind, object seq, object default=*) cpdef object cons(object el, object seq) cpdef object concat(object seqs) cpdef object mapcat(object func, object seqs) cdef class interpose: cdef object el cdef object iter_seq cdef object val cdef bint do_el cpdef dict frequencies(object seq) cpdef dict reduceby(object key, object binop, object seq, object init=*) cdef class iterate: cdef object func cdef object x cdef object val cdef class sliding_window: cdef object iterseq cdef tuple prev cdef Py_ssize_t n cpdef object partition(Py_ssize_t n, object seq, object pad=*) cdef class partition_all: cdef Py_ssize_t n cdef object iterseq cpdef object count(object seq) cdef class _pluck_index: cdef object ind cdef object iterseqs cdef class _pluck_index_default: cdef object ind cdef object iterseqs cdef object default cdef class _pluck_list: cdef list ind cdef object iterseqs cdef Py_ssize_t n cdef class _pluck_list_default: cdef list ind cdef object iterseqs cdef object default cdef Py_ssize_t n cpdef object pluck(object ind, object seqs, object default=*) cdef class _getter_index: cdef object ind cdef class _getter_list: cdef list ind cdef Py_ssize_t n cdef class _getter_null: pass cpdef object getter(object index) cpdef object join(object leftkey, object leftseq, object rightkey, object rightseq, object left_default=*, object right_default=*) cdef class _join: cdef dict d cdef list matches cdef set seen_keys cdef object leftseq cdef object rightseq cdef object _rightkey cdef object right cdef object left_default cdef object right_default cdef object keys cdef Py_ssize_t N cdef Py_ssize_t i cdef bint is_rightseq_exhausted cdef object rightkey(self) cdef class _inner_join(_join): pass cdef class _right_outer_join(_join): pass cdef class _left_outer_join(_join): pass cdef class _outer_join(_join): pass cdef class _inner_join_key(_inner_join): pass cdef class _inner_join_index(_inner_join): pass cdef class _inner_join_indices(_inner_join): pass cdef class _right_outer_join_key(_right_outer_join): pass cdef class _right_outer_join_index(_right_outer_join): pass cdef class _right_outer_join_indices(_right_outer_join): pass cdef class _left_outer_join_key(_left_outer_join): pass cdef class _left_outer_join_index(_left_outer_join): pass cdef class _left_outer_join_indices(_left_outer_join): pass cdef class _outer_join_key(_outer_join): pass cdef class _outer_join_index(_outer_join): pass cdef class _outer_join_indices(_outer_join): pass cdef class _diff_key: cdef Py_ssize_t N cdef object iters cdef object key cdef class _diff_identity: cdef Py_ssize_t N cdef object iters cdef object c_diff(object seqs, object default=*, object key=*) cpdef object topk(Py_ssize_t k, object seq, object key=*) cpdef object peek(object seq) cpdef object peekn(Py_ssize_t n, object seq) cdef class random_sample: cdef object iter_seq cdef object prob cdef object random_func cytoolz-0.10.1/cytoolz/itertoolz.pyx000066400000000000000000001440151355770264200176140ustar00rootroot00000000000000from cpython.dict cimport PyDict_GetItem, PyDict_SetItem from cpython.exc cimport PyErr_Clear, PyErr_GivenExceptionMatches, PyErr_Occurred from cpython.list cimport PyList_Append, PyList_GET_ITEM, PyList_GET_SIZE from cpython.object cimport PyObject_RichCompareBool, Py_NE from cpython.ref cimport PyObject, Py_INCREF, Py_XDECREF from cpython.sequence cimport PySequence_Check from cpython.set cimport PySet_Add, PySet_Contains from cpython.tuple cimport PyTuple_GET_ITEM, PyTuple_GetSlice, PyTuple_New, PyTuple_SET_ITEM # Locally defined bindings that differ from `cython.cpython` bindings from cytoolz.cpython cimport PtrIter_Next, PtrObject_GetItem from collections import deque from heapq import heapify, heappop, heapreplace from itertools import chain, islice from operator import itemgetter from random import Random from cytoolz.compatibility import map, zip, zip_longest from cytoolz.utils import no_default __all__ = ['remove', 'accumulate', 'groupby', 'merge_sorted', 'interleave', 'unique', 'isiterable', 'isdistinct', 'take', 'drop', 'take_nth', 'first', 'second', 'nth', 'last', 'get', 'concat', 'concatv', 'mapcat', 'cons', 'interpose', 'frequencies', 'reduceby', 'iterate', 'sliding_window', 'partition', 'partition_all', 'count', 'pluck', 'join', 'tail', 'diff', 'topk', 'peek', 'peekn', 'random_sample'] cpdef object identity(object x): return x cdef class remove: """ remove(predicate, seq) Return those items of sequence for which predicate(item) is False >>> def iseven(x): ... return x % 2 == 0 >>> list(remove(iseven, [1, 2, 3, 4])) [1, 3] """ def __cinit__(self, object predicate, object seq): self.predicate = predicate self.iter_seq = iter(seq) def __iter__(self): return self def __next__(self): cdef object val val = next(self.iter_seq) while self.predicate(val): val = next(self.iter_seq) return val cdef class accumulate: """ accumulate(binop, seq, initial='__no__default__') Repeatedly apply binary function to a sequence, accumulating results >>> from operator import add, mul >>> list(accumulate(add, [1, 2, 3, 4, 5])) [1, 3, 6, 10, 15] >>> list(accumulate(mul, [1, 2, 3, 4, 5])) [1, 2, 6, 24, 120] Accumulate is similar to ``reduce`` and is good for making functions like cumulative sum: >>> from functools import partial, reduce >>> sum = partial(reduce, add) >>> cumsum = partial(accumulate, add) Accumulate also takes an optional argument that will be used as the first value. This is similar to reduce. >>> list(accumulate(add, [1, 2, 3], -1)) [-1, 0, 2, 5] >>> list(accumulate(add, [], 1)) [1] See Also: itertools.accumulate : In standard itertools for Python 3.2+ """ def __cinit__(self, object binop, object seq, object initial='__no__default__'): self.binop = binop self.iter_seq = iter(seq) self.result = self # sentinel self.initial = initial def __iter__(self): return self def __next__(self): if self.result is self: if self.initial != no_default: self.result = self.initial else: self.result = next(self.iter_seq) else: self.result = self.binop(self.result, next(self.iter_seq)) return self.result cdef inline object _groupby_core(dict d, object key, object item): cdef PyObject *obj = PyDict_GetItem(d, key) if obj is NULL: val = [] PyList_Append(val, item) PyDict_SetItem(d, key, val) else: PyList_Append(obj, item) cpdef dict groupby(object key, object seq): """ Group a collection by a key function >>> names = ['Alice', 'Bob', 'Charlie', 'Dan', 'Edith', 'Frank'] >>> groupby(len, names) # doctest: +SKIP {3: ['Bob', 'Dan'], 5: ['Alice', 'Edith', 'Frank'], 7: ['Charlie']} >>> iseven = lambda x: x % 2 == 0 >>> groupby(iseven, [1, 2, 3, 4, 5, 6, 7, 8]) # doctest: +SKIP {False: [1, 3, 5, 7], True: [2, 4, 6, 8]} Non-callable keys imply grouping on a member. >>> groupby('gender', [{'name': 'Alice', 'gender': 'F'}, ... {'name': 'Bob', 'gender': 'M'}, ... {'name': 'Charlie', 'gender': 'M'}]) # doctest:+SKIP {'F': [{'gender': 'F', 'name': 'Alice'}], 'M': [{'gender': 'M', 'name': 'Bob'}, {'gender': 'M', 'name': 'Charlie'}]} Not to be confused with ``itertools.groupby`` See Also: countby """ cdef dict d = {} cdef object item, keyval cdef Py_ssize_t i, N if callable(key): for item in seq: keyval = key(item) _groupby_core(d, keyval, item) elif isinstance(key, list): N = PyList_GET_SIZE(key) for item in seq: keyval = PyTuple_New(N) for i in range(N): val = PyList_GET_ITEM(key, i) val = item[val] Py_INCREF(val) PyTuple_SET_ITEM(keyval, i, val) _groupby_core(d, keyval, item) else: for item in seq: keyval = item[key] _groupby_core(d, keyval, item) return d cdef object _merge_sorted_binary(object seqs): mid = len(seqs) // 2 L1 = seqs[:mid] if len(L1) == 1: seq1 = iter(L1[0]) else: seq1 = _merge_sorted_binary(L1) L2 = seqs[mid:] if len(L2) == 1: seq2 = iter(L2[0]) else: seq2 = _merge_sorted_binary(L2) try: val2 = next(seq2) except StopIteration: return seq1 return _merge_sorted(seq1, seq2, val2) cdef class _merge_sorted: def __cinit__(self, seq1, seq2, val2): self.seq1 = seq1 self.seq2 = seq2 self.val1 = None self.val2 = val2 self.loop = 0 def __iter__(self): return self def __next__(self): if self.loop == 0: try: self.val1 = next(self.seq1) except StopIteration: self.loop = 2 return self.val2 if self.val2 < self.val1: self.loop = 1 return self.val2 return self.val1 elif self.loop == 1: try: self.val2 = next(self.seq2) except StopIteration: self.loop = 3 return self.val1 if self.val2 < self.val1: return self.val2 self.loop = 0 return self.val1 elif self.loop == 2: return next(self.seq2) return next(self.seq1) cdef object _merge_sorted_binary_key(object seqs, object key): mid = len(seqs) // 2 L1 = seqs[:mid] if len(L1) == 1: seq1 = iter(L1[0]) else: seq1 = _merge_sorted_binary_key(L1, key) L2 = seqs[mid:] if len(L2) == 1: seq2 = iter(L2[0]) else: seq2 = _merge_sorted_binary_key(L2, key) try: val2 = next(seq2) except StopIteration: return seq1 return _merge_sorted_key(seq1, seq2, val2, key) cdef class _merge_sorted_key: def __cinit__(self, seq1, seq2, val2, key): self.seq1 = seq1 self.seq2 = seq2 self.key = key self.val1 = None self.key1 = None self.val2 = val2 self.key2 = key(val2) self.loop = 0 def __iter__(self): return self def __next__(self): if self.loop == 0: try: self.val1 = next(self.seq1) except StopIteration: self.loop = 2 return self.val2 self.key1 = self.key(self.val1) if self.key2 < self.key1: self.loop = 1 return self.val2 return self.val1 elif self.loop == 1: try: self.val2 = next(self.seq2) except StopIteration: self.loop = 3 return self.val1 self.key2 = self.key(self.val2) if self.key2 < self.key1: return self.val2 self.loop = 0 return self.val1 elif self.loop == 2: return next(self.seq2) return next(self.seq1) cdef object c_merge_sorted(object seqs, object key=None): if len(seqs) == 0: return iter([]) elif len(seqs) == 1: return iter(seqs[0]) elif key is None: return _merge_sorted_binary(seqs) return _merge_sorted_binary_key(seqs, key) def merge_sorted(*seqs, **kwargs): """ Merge and sort a collection of sorted collections This works lazily and only keeps one value from each iterable in memory. >>> list(merge_sorted([1, 3, 5], [2, 4, 6])) [1, 2, 3, 4, 5, 6] >>> ''.join(merge_sorted('abc', 'abc', 'abc')) 'aaabbbccc' The "key" function used to sort the input may be passed as a keyword. >>> list(merge_sorted([2, 3], [1, 3], key=lambda x: x // 3)) [2, 1, 3, 3] """ if 'key' in kwargs: return c_merge_sorted(seqs, kwargs['key']) return c_merge_sorted(seqs) cdef class interleave: """ interleave(seqs) Interleave a sequence of sequences >>> list(interleave([[1, 2], [3, 4]])) [1, 3, 2, 4] >>> ''.join(interleave(('ABC', 'XY'))) 'AXBYC' Both the individual sequences and the sequence of sequences may be infinite Returns a lazy iterator """ def __cinit__(self, seqs): self.iters = [iter(seq) for seq in seqs] self.newiters = [] self.i = 0 self.n = PyList_GET_SIZE(self.iters) def __iter__(self): return self def __next__(self): # This implementation is similar to what is done in `toolz` in that we # construct a new list of iterators, `self.newiters`, when a value is # successfully retrieved from an iterator from `self.iters`. cdef PyObject *obj cdef object val if self.i == self.n: self.n = PyList_GET_SIZE(self.newiters) self.i = 0 if self.n == 0: raise StopIteration self.iters = self.newiters self.newiters = [] val = PyList_GET_ITEM(self.iters, self.i) self.i += 1 obj = PtrIter_Next(val) # TODO: optimization opportunity. Previously, it was possible to # continue on given exceptions, `self.pass_exceptions`, which is # why this code is structured this way. Time to clean up? while obj is NULL: obj = PyErr_Occurred() if obj is not NULL: val = obj PyErr_Clear() raise val if self.i == self.n: self.n = PyList_GET_SIZE(self.newiters) self.i = 0 if self.n == 0: raise StopIteration self.iters = self.newiters self.newiters = [] val = PyList_GET_ITEM(self.iters, self.i) self.i += 1 obj = PtrIter_Next(val) PyList_Append(self.newiters, val) val = obj Py_XDECREF(obj) return val cdef class _unique_key: def __cinit__(self, object seq, object key): self.iter_seq = iter(seq) self.key = key self.seen = set() def __iter__(self): return self def __next__(self): cdef object item, tag item = next(self.iter_seq) tag = self.key(item) while PySet_Contains(self.seen, tag): item = next(self.iter_seq) tag = self.key(item) PySet_Add(self.seen, tag) return item cdef class _unique_identity: def __cinit__(self, object seq): self.iter_seq = iter(seq) self.seen = set() def __iter__(self): return self def __next__(self): cdef object item item = next(self.iter_seq) while PySet_Contains(self.seen, item): item = next(self.iter_seq) PySet_Add(self.seen, item) return item cpdef object unique(object seq, object key=None): """ Return only unique elements of a sequence >>> tuple(unique((1, 2, 3))) (1, 2, 3) >>> tuple(unique((1, 2, 1, 3))) (1, 2, 3) Uniqueness can be defined by key keyword >>> tuple(unique(['cat', 'mouse', 'dog', 'hen'], key=len)) ('cat', 'mouse') """ if key is None: return _unique_identity(seq) else: return _unique_key(seq, key) cpdef object isiterable(object x): """ Is x iterable? >>> isiterable([1, 2, 3]) True >>> isiterable('abc') True >>> isiterable(5) False """ try: iter(x) return True except TypeError: pass return False cpdef object isdistinct(object seq): """ All values in sequence are distinct >>> isdistinct([1, 2, 3]) True >>> isdistinct([1, 2, 1]) False >>> isdistinct("Hello") False >>> isdistinct("World") True """ if iter(seq) is seq: seen = set() for item in seq: if PySet_Contains(seen, item): return False seen.add(item) return True else: return len(seq) == len(set(seq)) cpdef object take(Py_ssize_t n, object seq): """ The first n elements of a sequence >>> list(take(2, [10, 20, 30, 40, 50])) [10, 20] See Also: drop tail """ return islice(seq, n) cpdef object tail(Py_ssize_t n, object seq): """ The last n elements of a sequence >>> tail(2, [10, 20, 30, 40, 50]) [40, 50] See Also: drop take """ if PySequence_Check(seq): return seq[-n:] return tuple(deque(seq, n)) cpdef object drop(Py_ssize_t n, object seq): """ The sequence following the first n elements >>> list(drop(2, [10, 20, 30, 40, 50])) [30, 40, 50] See Also: take tail """ if n < 0: raise ValueError('n argument for drop() must be non-negative') cdef Py_ssize_t i cdef object iter_seq iter_seq = iter(seq) try: for i in range(n): next(iter_seq) except StopIteration: pass return iter_seq cpdef object take_nth(Py_ssize_t n, object seq): """ Every nth item in seq >>> list(take_nth(2, [10, 20, 30, 40, 50])) [10, 30, 50] """ return islice(seq, 0, None, n) cpdef object first(object seq): """ The first element in a sequence >>> first('ABC') 'A' """ return next(iter(seq)) cpdef object second(object seq): """ The second element in a sequence >>> second('ABC') 'B' """ seq = iter(seq) next(seq) return next(seq) cpdef object nth(Py_ssize_t n, object seq): """ The nth element in a sequence >>> nth(1, 'ABC') 'B' """ if PySequence_Check(seq): return seq[n] if n < 0: raise ValueError('"n" must be positive when indexing an iterator') seq = iter(seq) while n > 0: n -= 1 next(seq) return next(seq) cpdef object last(object seq): """ The last element in a sequence >>> last('ABC') 'C' """ cdef object val if PySequence_Check(seq): return seq[-1] val = no_default for val in seq: pass if val == no_default: raise IndexError return val cpdef object rest(object seq): seq = iter(seq) next(seq) return seq cdef tuple _get_exceptions = (IndexError, KeyError, TypeError) cdef tuple _get_list_exc = (IndexError, KeyError) cpdef object get(object ind, object seq, object default='__no__default__'): """ Get element in a sequence or dict Provides standard indexing >>> get(1, 'ABC') # Same as 'ABC'[1] 'B' Pass a list to get multiple values >>> get([1, 2], 'ABC') # ('ABC'[1], 'ABC'[2]) ('B', 'C') Works on any value that supports indexing/getitem For example here we see that it works with dictionaries >>> phonebook = {'Alice': '555-1234', ... 'Bob': '555-5678', ... 'Charlie':'555-9999'} >>> get('Alice', phonebook) '555-1234' >>> get(['Alice', 'Bob'], phonebook) ('555-1234', '555-5678') Provide a default for missing values >>> get(['Alice', 'Dennis'], phonebook, None) ('555-1234', None) See Also: pluck """ cdef Py_ssize_t i cdef object val cdef tuple result cdef PyObject *obj if isinstance(ind, list): i = PyList_GET_SIZE(ind) result = PyTuple_New(i) # List of indices, no default if default == no_default: for i, val in enumerate(ind): val = seq[val] Py_INCREF(val) PyTuple_SET_ITEM(result, i, val) return result # List of indices with default for i, val in enumerate(ind): obj = PtrObject_GetItem(seq, val) if obj is NULL: val = PyErr_Occurred() PyErr_Clear() if not PyErr_GivenExceptionMatches(val, _get_list_exc): raise val Py_INCREF(default) PyTuple_SET_ITEM(result, i, default) else: val = obj PyTuple_SET_ITEM(result, i, val) return result obj = PtrObject_GetItem(seq, ind) if obj is NULL: val = PyErr_Occurred() PyErr_Clear() if default == no_default: raise val if PyErr_GivenExceptionMatches(val, _get_exceptions): return default raise val val = obj Py_XDECREF(obj) return val cpdef object concat(object seqs): """ Concatenate zero or more iterables, any of which may be infinite. An infinite sequence will prevent the rest of the arguments from being included. We use chain.from_iterable rather than ``chain(*seqs)`` so that seqs can be a generator. >>> list(concat([[], [1], [2, 3]])) [1, 2, 3] See also: itertools.chain.from_iterable equivalent """ return chain.from_iterable(seqs) def concatv(*seqs): """ Variadic version of concat >>> list(concatv([], ["a"], ["b", "c"])) ['a', 'b', 'c'] See also: itertools.chain """ return chain.from_iterable(seqs) cpdef object mapcat(object func, object seqs): """ Apply func to each sequence in seqs, concatenating results. >>> list(mapcat(lambda s: [c.upper() for c in s], ... [["a", "b"], ["c", "d", "e"]])) ['A', 'B', 'C', 'D', 'E'] """ return concat(map(func, seqs)) cpdef object cons(object el, object seq): """ Add el to beginning of (possibly infinite) sequence seq. >>> list(cons(1, [2, 3])) [1, 2, 3] """ return chain((el,), seq) cdef class interpose: """ interpose(el, seq) Introduce element between each pair of elements in seq >>> list(interpose("a", [1, 2, 3])) [1, 'a', 2, 'a', 3] """ def __cinit__(self, object el, object seq): self.el = el self.iter_seq = iter(seq) self.do_el = False try: self.val = next(self.iter_seq) except StopIteration: self.do_el = True def __iter__(self): return self def __next__(self): if self.do_el: self.val = next(self.iter_seq) self.do_el = False return self.el else: self.do_el = True return self.val cpdef dict frequencies(object seq): """ Find number of occurrences of each value in seq >>> frequencies(['cat', 'cat', 'ox', 'pig', 'pig', 'cat']) #doctest: +SKIP {'cat': 3, 'ox': 1, 'pig': 2} See Also: countby groupby """ cdef dict d = {} cdef PyObject *obj cdef Py_ssize_t val for item in seq: obj = PyDict_GetItem(d, item) if obj is NULL: d[item] = 1 else: val = obj d[item] = val + 1 return d cdef inline object _reduceby_core(dict d, object key, object item, object binop, object init, bint skip_init, bint call_init): cdef PyObject *obj = PyDict_GetItem(d, key) if obj is not NULL: PyDict_SetItem(d, key, binop(obj, item)) elif skip_init: PyDict_SetItem(d, key, item) elif call_init: PyDict_SetItem(d, key, binop(init(), item)) else: PyDict_SetItem(d, key, binop(init, item)) cpdef dict reduceby(object key, object binop, object seq, object init='__no__default__'): """ Perform a simultaneous groupby and reduction The computation: >>> result = reduceby(key, binop, seq, init) # doctest: +SKIP is equivalent to the following: >>> def reduction(group): # doctest: +SKIP ... return reduce(binop, group, init) # doctest: +SKIP >>> groups = groupby(key, seq) # doctest: +SKIP >>> result = valmap(reduction, groups) # doctest: +SKIP But the former does not build the intermediate groups, allowing it to operate in much less space. This makes it suitable for larger datasets that do not fit comfortably in memory The ``init`` keyword argument is the default initialization of the reduction. This can be either a constant value like ``0`` or a callable like ``lambda : 0`` as might be used in ``defaultdict``. Simple Examples --------------- >>> from operator import add, mul >>> iseven = lambda x: x % 2 == 0 >>> data = [1, 2, 3, 4, 5] >>> reduceby(iseven, add, data) # doctest: +SKIP {False: 9, True: 6} >>> reduceby(iseven, mul, data) # doctest: +SKIP {False: 15, True: 8} Complex Example --------------- >>> projects = [{'name': 'build roads', 'state': 'CA', 'cost': 1000000}, ... {'name': 'fight crime', 'state': 'IL', 'cost': 100000}, ... {'name': 'help farmers', 'state': 'IL', 'cost': 2000000}, ... {'name': 'help farmers', 'state': 'CA', 'cost': 200000}] >>> reduceby('state', # doctest: +SKIP ... lambda acc, x: acc + x['cost'], ... projects, 0) {'CA': 1200000, 'IL': 2100000} Example Using ``init`` ---------------------- >>> def set_add(s, i): ... s.add(i) ... return s >>> reduceby(iseven, set_add, [1, 2, 3, 4, 1, 2, 3], set) # doctest: +SKIP {True: set([2, 4]), False: set([1, 3])} """ cdef dict d = {} cdef object item, keyval cdef Py_ssize_t i, N cdef bint skip_init = init == no_default cdef bint call_init = callable(init) if callable(key): for item in seq: keyval = key(item) _reduceby_core(d, keyval, item, binop, init, skip_init, call_init) elif isinstance(key, list): N = PyList_GET_SIZE(key) for item in seq: keyval = PyTuple_New(N) for i in range(N): val = PyList_GET_ITEM(key, i) val = item[val] Py_INCREF(val) PyTuple_SET_ITEM(keyval, i, val) _reduceby_core(d, keyval, item, binop, init, skip_init, call_init) else: for item in seq: keyval = item[key] _reduceby_core(d, keyval, item, binop, init, skip_init, call_init) return d cdef class iterate: """ iterate(func, x) Repeatedly apply a function func onto an original input Yields x, then func(x), then func(func(x)), then func(func(func(x))), etc.. >>> def inc(x): return x + 1 >>> counter = iterate(inc, 0) >>> next(counter) 0 >>> next(counter) 1 >>> next(counter) 2 >>> double = lambda x: x * 2 >>> powers_of_two = iterate(double, 1) >>> next(powers_of_two) 1 >>> next(powers_of_two) 2 >>> next(powers_of_two) 4 >>> next(powers_of_two) 8 """ def __cinit__(self, object func, object x): self.func = func self.x = x self.val = self # sentinel def __iter__(self): return self def __next__(self): if self.val is self: self.val = self.x else: self.x = self.func(self.x) return self.x cdef class sliding_window: """ sliding_window(n, seq) A sequence of overlapping subsequences >>> list(sliding_window(2, [1, 2, 3, 4])) [(1, 2), (2, 3), (3, 4)] This function creates a sliding window suitable for transformations like sliding means / smoothing >>> mean = lambda seq: float(sum(seq)) / len(seq) >>> list(map(mean, sliding_window(2, [1, 2, 3, 4]))) [1.5, 2.5, 3.5] """ def __cinit__(self, Py_ssize_t n, object seq): cdef Py_ssize_t i self.iterseq = iter(seq) self.prev = PyTuple_New(n) for i, seq in enumerate(islice(self.iterseq, n-1), 1): Py_INCREF(seq) PyTuple_SET_ITEM(self.prev, i, seq) self.n = n def __iter__(self): return self def __next__(self): cdef tuple current cdef object item cdef Py_ssize_t i item = next(self.iterseq) current = PyTuple_New(self.n) Py_INCREF(item) PyTuple_SET_ITEM(current, self.n-1, item) for i in range(1, self.n): item = self.prev[i] Py_INCREF(item) PyTuple_SET_ITEM(current, i-1, item) self.prev = current return current no_pad = '__no__pad__' cpdef object partition(Py_ssize_t n, object seq, object pad='__no__pad__'): """ Partition sequence into tuples of length n >>> list(partition(2, [1, 2, 3, 4])) [(1, 2), (3, 4)] If the length of ``seq`` is not evenly divisible by ``n``, the final tuple is dropped if ``pad`` is not specified, or filled to length ``n`` by pad: >>> list(partition(2, [1, 2, 3, 4, 5])) [(1, 2), (3, 4)] >>> list(partition(2, [1, 2, 3, 4, 5], pad=None)) [(1, 2), (3, 4), (5, None)] See Also: partition_all """ args = [iter(seq)] * n if pad == '__no__pad__': return zip(*args) else: return zip_longest(*args, fillvalue=pad) cdef class partition_all: """ partition_all(n, seq) Partition all elements of sequence into tuples of length at most n The final tuple may be shorter to accommodate extra elements. >>> list(partition_all(2, [1, 2, 3, 4])) [(1, 2), (3, 4)] >>> list(partition_all(2, [1, 2, 3, 4, 5])) [(1, 2), (3, 4), (5,)] See Also: partition """ def __cinit__(self, Py_ssize_t n, object seq): self.n = n self.iterseq = iter(seq) def __iter__(self): return self def __next__(self): cdef tuple result cdef object item cdef Py_ssize_t i = 0 result = PyTuple_New(self.n) for item in self.iterseq: Py_INCREF(item) PyTuple_SET_ITEM(result, i, item) i += 1 if i == self.n: return result # iterable exhausted before filling the tuple if i == 0: raise StopIteration return PyTuple_GetSlice(result, 0, i) cpdef object count(object seq): """ Count the number of items in seq Like the builtin ``len`` but works on lazy sequencies. Not to be confused with ``itertools.count`` See also: len """ if iter(seq) is not seq and hasattr(seq, '__len__'): return len(seq) cdef Py_ssize_t i = 0 for _ in seq: i += 1 return i cdef class _pluck_index: def __cinit__(self, object ind, object seqs): self.ind = ind self.iterseqs = iter(seqs) def __iter__(self): return self def __next__(self): val = next(self.iterseqs) return val[self.ind] cdef class _pluck_index_default: def __cinit__(self, object ind, object seqs, object default): self.ind = ind self.iterseqs = iter(seqs) self.default = default def __iter__(self): return self def __next__(self): cdef PyObject *obj cdef object val val = next(self.iterseqs) obj = PtrObject_GetItem(val, self.ind) if obj is NULL: val = PyErr_Occurred() PyErr_Clear() if not PyErr_GivenExceptionMatches(val, _get_exceptions): raise val return self.default val = obj Py_XDECREF(obj) return val cdef class _pluck_list: def __cinit__(self, list ind not None, object seqs): self.ind = ind self.iterseqs = iter(seqs) self.n = len(ind) def __iter__(self): return self def __next__(self): cdef Py_ssize_t i cdef tuple result cdef object val, seq seq = next(self.iterseqs) result = PyTuple_New(self.n) for i, val in enumerate(self.ind): val = seq[val] Py_INCREF(val) PyTuple_SET_ITEM(result, i, val) return result cdef class _pluck_list_default: def __cinit__(self, list ind not None, object seqs, object default): self.ind = ind self.iterseqs = iter(seqs) self.default = default self.n = len(ind) def __iter__(self): return self def __next__(self): cdef Py_ssize_t i cdef object val, seq cdef tuple result seq = next(self.iterseqs) result = PyTuple_New(self.n) for i, val in enumerate(self.ind): obj = PtrObject_GetItem(seq, val) if obj is NULL: val = PyErr_Occurred() PyErr_Clear() if not PyErr_GivenExceptionMatches(val, _get_list_exc): raise val Py_INCREF(self.default) PyTuple_SET_ITEM(result, i, self.default) else: val = obj PyTuple_SET_ITEM(result, i, val) return result cpdef object pluck(object ind, object seqs, object default='__no__default__'): """ plucks an element or several elements from each item in a sequence. ``pluck`` maps ``itertoolz.get`` over a sequence and returns one or more elements of each item in the sequence. This is equivalent to running `map(curried.get(ind), seqs)` ``ind`` can be either a single string/index or a list of strings/indices. ``seqs`` should be sequence containing sequences or dicts. e.g. >>> data = [{'id': 1, 'name': 'Cheese'}, {'id': 2, 'name': 'Pies'}] >>> list(pluck('name', data)) ['Cheese', 'Pies'] >>> list(pluck([0, 1], [[1, 2, 3], [4, 5, 7]])) [(1, 2), (4, 5)] See Also: get map """ if isinstance(ind, list): if default != no_default: return _pluck_list_default(ind, seqs, default) if PyList_GET_SIZE(ind) < 10: return _pluck_list(ind, seqs) return map(itemgetter(*ind), seqs) if default == no_default: return _pluck_index(ind, seqs) return _pluck_index_default(ind, seqs, default) cdef class _getter_index: def __cinit__(self, object ind): self.ind = ind def __call__(self, object seq): return seq[self.ind] cdef class _getter_list: def __cinit__(self, list ind not None): self.ind = ind self.n = len(ind) def __call__(self, object seq): cdef Py_ssize_t i cdef tuple result cdef object val result = PyTuple_New(self.n) for i, val in enumerate(self.ind): val = seq[val] Py_INCREF(val) PyTuple_SET_ITEM(result, i, val) return result cdef class _getter_null: def __call__(self, object seq): return () # TODO: benchmark getters (and compare against itemgetter) cpdef object getter(object index): if isinstance(index, list): if PyList_GET_SIZE(index) == 0: return _getter_null() elif PyList_GET_SIZE(index) < 10: return _getter_list(index) return itemgetter(*index) return _getter_index(index) cpdef object join(object leftkey, object leftseq, object rightkey, object rightseq, object left_default='__no__default__', object right_default='__no__default__'): """ Join two sequences on common attributes This is a semi-streaming operation. The LEFT sequence is fully evaluated and placed into memory. The RIGHT sequence is evaluated lazily and so can be arbitrarily large. (Note: If right_default is defined, then unique keys of rightseq will also be stored in memory.) >>> friends = [('Alice', 'Edith'), ... ('Alice', 'Zhao'), ... ('Edith', 'Alice'), ... ('Zhao', 'Alice'), ... ('Zhao', 'Edith')] >>> cities = [('Alice', 'NYC'), ... ('Alice', 'Chicago'), ... ('Dan', 'Syndey'), ... ('Edith', 'Paris'), ... ('Edith', 'Berlin'), ... ('Zhao', 'Shanghai')] >>> # Vacation opportunities >>> # In what cities do people have friends? >>> result = join(second, friends, ... first, cities) >>> for ((a, b), (c, d)) in sorted(unique(result)): ... print((a, d)) ('Alice', 'Berlin') ('Alice', 'Paris') ('Alice', 'Shanghai') ('Edith', 'Chicago') ('Edith', 'NYC') ('Zhao', 'Chicago') ('Zhao', 'NYC') ('Zhao', 'Berlin') ('Zhao', 'Paris') Specify outer joins with keyword arguments ``left_default`` and/or ``right_default``. Here is a full outer join in which unmatched elements are paired with None. >>> identity = lambda x: x >>> list(join(identity, [1, 2, 3], ... identity, [2, 3, 4], ... left_default=None, right_default=None)) [(2, 2), (3, 3), (None, 4), (1, None)] Usually the key arguments are callables to be applied to the sequences. If the keys are not obviously callable then it is assumed that indexing was intended, e.g. the following is a legal change. The join is implemented as a hash join and the keys of leftseq must be hashable. Additionally, if right_default is defined, then keys of rightseq must also be hashable. >>> # result = join(second, friends, first, cities) >>> result = join(1, friends, 0, cities) # doctest: +SKIP """ if left_default == no_default and right_default == no_default: if callable(rightkey): return _inner_join_key(leftkey, leftseq, rightkey, rightseq, left_default, right_default) elif isinstance(rightkey, list): return _inner_join_indices(leftkey, leftseq, rightkey, rightseq, left_default, right_default) else: return _inner_join_index(leftkey, leftseq, rightkey, rightseq, left_default, right_default) elif left_default != no_default and right_default == no_default: if callable(rightkey): return _right_outer_join_key(leftkey, leftseq, rightkey, rightseq, left_default, right_default) elif isinstance(rightkey, list): return _right_outer_join_indices(leftkey, leftseq, rightkey, rightseq, left_default, right_default) else: return _right_outer_join_index(leftkey, leftseq, rightkey, rightseq, left_default, right_default) elif left_default == no_default and right_default != no_default: if callable(rightkey): return _left_outer_join_key(leftkey, leftseq, rightkey, rightseq, left_default, right_default) elif isinstance(rightkey, list): return _left_outer_join_indices(leftkey, leftseq, rightkey, rightseq, left_default, right_default) else: return _left_outer_join_index(leftkey, leftseq, rightkey, rightseq, left_default, right_default) else: if callable(rightkey): return _outer_join_key(leftkey, leftseq, rightkey, rightseq, left_default, right_default) elif isinstance(rightkey, list): return _outer_join_indices(leftkey, leftseq, rightkey, rightseq, left_default, right_default) else: return _outer_join_index(leftkey, leftseq, rightkey, rightseq, left_default, right_default) cdef class _join: def __cinit__(self, object leftkey, object leftseq, object rightkey, object rightseq, object left_default=no_default, object right_default=no_default): self.left_default = left_default self.right_default = right_default self._rightkey = rightkey self.rightseq = iter(rightseq) if isinstance(rightkey, list): self.N = len(rightkey) self.d = groupby(leftkey, leftseq) self.seen_keys = set() self.matches = [] self.right = None self.is_rightseq_exhausted = False def __iter__(self): return self cdef object rightkey(self): pass cdef class _right_outer_join(_join): def __next__(self): cdef PyObject *obj if self.i == PyList_GET_SIZE(self.matches): self.right = next(self.rightseq) key = self.rightkey() obj = PyDict_GetItem(self.d, key) if obj is NULL: return (self.left_default, self.right) self.matches = obj self.i = 0 match = PyList_GET_ITEM(self.matches, self.i) # skip error checking self.i += 1 return (match, self.right) cdef class _right_outer_join_key(_right_outer_join): cdef object rightkey(self): return self._rightkey(self.right) cdef class _right_outer_join_index(_right_outer_join): cdef object rightkey(self): return self.right[self._rightkey] cdef class _right_outer_join_indices(_right_outer_join): cdef object rightkey(self): keyval = PyTuple_New(self.N) for i in range(self.N): val = PyList_GET_ITEM(self._rightkey, i) val = self.right[val] Py_INCREF(val) PyTuple_SET_ITEM(keyval, i, val) return keyval cdef class _outer_join(_join): def __next__(self): cdef PyObject *obj if not self.is_rightseq_exhausted: if self.i == PyList_GET_SIZE(self.matches): try: self.right = next(self.rightseq) except StopIteration: self.is_rightseq_exhausted = True self.keys = iter(self.d) return next(self) key = self.rightkey() PySet_Add(self.seen_keys, key) obj = PyDict_GetItem(self.d, key) if obj is NULL: return (self.left_default, self.right) self.matches = obj self.i = 0 match = PyList_GET_ITEM(self.matches, self.i) # skip error checking self.i += 1 return (match, self.right) else: if self.i == PyList_GET_SIZE(self.matches): key = next(self.keys) while key in self.seen_keys: key = next(self.keys) obj = PyDict_GetItem(self.d, key) self.matches = obj self.i = 0 match = PyList_GET_ITEM(self.matches, self.i) # skip error checking self.i += 1 return (match, self.right_default) cdef class _outer_join_key(_outer_join): cdef object rightkey(self): return self._rightkey(self.right) cdef class _outer_join_index(_outer_join): cdef object rightkey(self): return self.right[self._rightkey] cdef class _outer_join_indices(_outer_join): cdef object rightkey(self): keyval = PyTuple_New(self.N) for i in range(self.N): val = PyList_GET_ITEM(self._rightkey, i) val = self.right[val] Py_INCREF(val) PyTuple_SET_ITEM(keyval, i, val) return keyval cdef class _left_outer_join(_join): def __next__(self): cdef PyObject *obj if not self.is_rightseq_exhausted: if self.i == PyList_GET_SIZE(self.matches): obj = NULL while obj is NULL: try: self.right = next(self.rightseq) except StopIteration: self.is_rightseq_exhausted = True self.keys = iter(self.d) return next(self) key = self.rightkey() PySet_Add(self.seen_keys, key) obj = PyDict_GetItem(self.d, key) self.matches = obj self.i = 0 match = PyList_GET_ITEM(self.matches, self.i) # skip error checking self.i += 1 return (match, self.right) else: if self.i == PyList_GET_SIZE(self.matches): key = next(self.keys) while key in self.seen_keys: key = next(self.keys) obj = PyDict_GetItem(self.d, key) self.matches = obj self.i = 0 match = PyList_GET_ITEM(self.matches, self.i) # skip error checking self.i += 1 return (match, self.right_default) cdef class _left_outer_join_key(_left_outer_join): cdef object rightkey(self): return self._rightkey(self.right) cdef class _left_outer_join_index(_left_outer_join): cdef object rightkey(self): return self.right[self._rightkey] cdef class _left_outer_join_indices(_left_outer_join): cdef object rightkey(self): keyval = PyTuple_New(self.N) for i in range(self.N): val = PyList_GET_ITEM(self._rightkey, i) val = self.right[val] Py_INCREF(val) PyTuple_SET_ITEM(keyval, i, val) return keyval cdef class _inner_join(_join): def __next__(self): cdef PyObject *obj = NULL if self.i == PyList_GET_SIZE(self.matches): while obj is NULL: self.right = next(self.rightseq) key = self.rightkey() obj = PyDict_GetItem(self.d, key) self.matches = obj self.i = 0 match = PyList_GET_ITEM(self.matches, self.i) # skip error checking self.i += 1 return (match, self.right) cdef class _inner_join_key(_inner_join): cdef object rightkey(self): return self._rightkey(self.right) cdef class _inner_join_index(_inner_join): cdef object rightkey(self): return self.right[self._rightkey] cdef class _inner_join_indices(_inner_join): cdef object rightkey(self): keyval = PyTuple_New(self.N) for i in range(self.N): val = PyList_GET_ITEM(self._rightkey, i) val = self.right[val] Py_INCREF(val) PyTuple_SET_ITEM(keyval, i, val) return keyval cdef class _diff_key: def __cinit__(self, object seqs, object key, object default=no_default): self.N = len(seqs) if self.N < 2: raise TypeError('Too few sequences given (min 2 required)') if default == no_default: self.iters = zip(*seqs) else: self.iters = zip_longest(*seqs, fillvalue=default) self.key = key def __iter__(self): return self def __next__(self): cdef object val, val2, items cdef Py_ssize_t i while True: items = next(self.iters) val = self.key(PyTuple_GET_ITEM(items, 0)) for i in range(1, self.N): val2 = self.key(PyTuple_GET_ITEM(items, i)) if PyObject_RichCompareBool(val, val2, Py_NE): return items cdef class _diff_identity: def __cinit__(self, object seqs, object default=no_default): self.N = len(seqs) if self.N < 2: raise TypeError('Too few sequences given (min 2 required)') if default == no_default: self.iters = zip(*seqs) else: self.iters = zip_longest(*seqs, fillvalue=default) def __iter__(self): return self def __next__(self): cdef object val, val2, items cdef Py_ssize_t i while True: items = next(self.iters) val = PyTuple_GET_ITEM(items, 0) for i in range(1, self.N): val2 = PyTuple_GET_ITEM(items, i) if PyObject_RichCompareBool(val, val2, Py_NE): return items cdef object c_diff(object seqs, object default=no_default, object key=None): if key is None: return _diff_identity(seqs, default=default) else: return _diff_key(seqs, key, default=default) def diff(*seqs, **kwargs): """ Return those items that differ between sequences >>> list(diff([1, 2, 3], [1, 2, 10, 100])) [(3, 10)] Shorter sequences may be padded with a ``default`` value: >>> list(diff([1, 2, 3], [1, 2, 10, 100], default=None)) [(3, 10), (None, 100)] A ``key`` function may also be applied to each item to use during comparisons: >>> list(diff(['apples', 'bananas'], ['Apples', 'Oranges'], key=str.lower)) [('bananas', 'Oranges')] """ N = len(seqs) if N == 1 and isinstance(seqs[0], list): seqs = seqs[0] default = kwargs.get('default', no_default) key = kwargs.get('key') return c_diff(seqs, default=default, key=key) cpdef object topk(Py_ssize_t k, object seq, object key=None): """ Find the k largest elements of a sequence Operates lazily in ``n*log(k)`` time >>> topk(2, [1, 100, 10, 1000]) (1000, 100) Use a key function to change sorted order >>> topk(2, ['Alice', 'Bob', 'Charlie', 'Dan'], key=len) ('Charlie', 'Alice') See also: heapq.nlargest """ cdef object item, val, top cdef object it = iter(seq) cdef object _heapreplace = heapreplace cdef Py_ssize_t i = k cdef list pq = [] if key is not None and not callable(key): key = getter(key) if k < 2: if k < 1: return () top = list(take(1, it)) if len(top) == 0: return () it = concatv(top, it) if key is None: return (max(it),) else: return (max(it, key=key),) for item in it: if key is None: PyList_Append(pq, (item, i)) else: PyList_Append(pq, (key(item), i, item)) i -= 1 if i == 0: break if i != 0: pq.sort(reverse=True) k = 0 if key is None else 2 return tuple([item[k] for item in pq]) heapify(pq) top = pq[0][0] if key is None: for item in it: if top < item: _heapreplace(pq, (item, i)) top = pq[0][0] i -= 1 else: for item in it: val = key(item) if top < val: _heapreplace(pq, (val, i, item)) top = pq[0][0] i -= 1 pq.sort(reverse=True) k = 0 if key is None else 2 return tuple([item[k] for item in pq]) cpdef object peek(object seq): """ Retrieve the next element of a sequence Returns the first element and an iterable equivalent to the original sequence, still having the element retrieved. >>> seq = [0, 1, 2, 3, 4] >>> first, seq = peek(seq) >>> first 0 >>> list(seq) [0, 1, 2, 3, 4] """ iterator = iter(seq) item = next(iterator) return item, chain((item,), iterator) cpdef object peekn(Py_ssize_t n, object seq): """ Retrieve the next n elements of a sequence Returns a tuple of the first n elements and an iterable equivalent to the original, still having the elements retrieved. >>> seq = [0, 1, 2, 3, 4] >>> first_two, seq = peekn(2, seq) >>> first_two (0, 1) >>> list(seq) [0, 1, 2, 3, 4] """ iterator = iter(seq) peeked = tuple(take(n, iterator)) return peeked, chain(iter(peeked), iterator) cdef class random_sample: """ random_sample(prob, seq, random_state=None) Return elements from a sequence with probability of prob Returns a lazy iterator of random items from seq. ``random_sample`` considers each item independently and without replacement. See below how the first time it returned 13 items and the next time it returned 6 items. >>> seq = list(range(100)) >>> list(random_sample(0.1, seq)) # doctest: +SKIP [6, 9, 19, 35, 45, 50, 58, 62, 68, 72, 78, 86, 95] >>> list(random_sample(0.1, seq)) # doctest: +SKIP [6, 44, 54, 61, 69, 94] Providing an integer seed for ``random_state`` will result in deterministic sampling. Given the same seed it will return the same sample every time. >>> list(random_sample(0.1, seq, random_state=2016)) [7, 9, 19, 25, 30, 32, 34, 48, 59, 60, 81, 98] >>> list(random_sample(0.1, seq, random_state=2016)) [7, 9, 19, 25, 30, 32, 34, 48, 59, 60, 81, 98] ``random_state`` can also be any object with a method ``random`` that returns floats between 0.0 and 1.0 (exclusive). >>> from random import Random >>> randobj = Random(2016) >>> list(random_sample(0.1, seq, random_state=randobj)) [7, 9, 19, 25, 30, 32, 34, 48, 59, 60, 81, 98] """ def __cinit__(self, object prob, object seq, random_state=None): float(prob) self.prob = prob self.iter_seq = iter(seq) if not hasattr(random_state, 'random'): random_state = Random(random_state) self.random_func = random_state.random def __iter__(self): return self def __next__(self): while True: if self.random_func() < self.prob: return next(self.iter_seq) next(self.iter_seq) cytoolz-0.10.1/cytoolz/recipes.c000066400000000000000000007556641355770264200166370ustar00rootroot00000000000000/* Generated by Cython 0.29.14 */ /* BEGIN: Cython Metadata { "distutils": { "depends": [], "name": "cytoolz.recipes", "sources": [ "cytoolz/recipes.pyx" ] }, "module_name": "cytoolz.recipes" } END: Cython Metadata */ #define PY_SSIZE_T_CLEAN #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 < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else #define CYTHON_ABI "0_29_14" #define CYTHON_HEX_VERSION 0x001D0EF0 #define CYTHON_FUTURE_DIVISION 0 #include #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 #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x02070000 #define HAVE_LONG_LONG #endif #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_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) #endif #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } # else # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int32 uint32_t; #endif #endif #else #include #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) && __cplusplus >= 201103L #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #elif __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__ ) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #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" #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #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) #endif #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_FAST_PYCCALL #define __Pyx_PyFastCFunction_Check(func)\ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 #define PyMem_RawMalloc(n) PyMem_Malloc(n) #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) #define PyMem_RawFree(p) PyMem_Free(p) #endif #if CYTHON_COMPILING_IN_PYSTON #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #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 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) #else #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) #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_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #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) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #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_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) #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])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if 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 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #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 #define PyObject_Unicode PyObject_Str #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_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #else #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #endif #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_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #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 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { \ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ } #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__cytoolz__recipes #define __PYX_HAVE_API__cytoolz__recipes /* Early includes */ #include #include #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const 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_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) 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); } #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_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_ASSUME_SAFE_MACROS #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 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(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*) "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) + 1); 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 CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_cython_runtime = NULL; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; 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[] = { "stringsource", "cytoolz/recipes.pyx", "type.pxd", "cytoolz/itertoolz.pxd", }; /*--- Type declarations ---*/ struct __pyx_obj_7cytoolz_9itertoolz_remove; struct __pyx_obj_7cytoolz_9itertoolz_accumulate; struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted; struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key; struct __pyx_obj_7cytoolz_9itertoolz_interleave; struct __pyx_obj_7cytoolz_9itertoolz__unique_key; struct __pyx_obj_7cytoolz_9itertoolz__unique_identity; struct __pyx_obj_7cytoolz_9itertoolz_interpose; struct __pyx_obj_7cytoolz_9itertoolz_iterate; struct __pyx_obj_7cytoolz_9itertoolz_sliding_window; struct __pyx_obj_7cytoolz_9itertoolz_partition_all; struct __pyx_obj_7cytoolz_9itertoolz__pluck_index; struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default; struct __pyx_obj_7cytoolz_9itertoolz__pluck_list; struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default; struct __pyx_obj_7cytoolz_9itertoolz__getter_index; struct __pyx_obj_7cytoolz_9itertoolz__getter_list; struct __pyx_obj_7cytoolz_9itertoolz__getter_null; struct __pyx_obj_7cytoolz_9itertoolz__join; struct __pyx_obj_7cytoolz_9itertoolz__inner_join; struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join; struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join; struct __pyx_obj_7cytoolz_9itertoolz__outer_join; struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key; struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index; struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices; struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key; struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index; struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices; struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key; struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index; struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices; struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key; struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index; struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices; struct __pyx_obj_7cytoolz_9itertoolz__diff_key; struct __pyx_obj_7cytoolz_9itertoolz__diff_identity; struct __pyx_obj_7cytoolz_9itertoolz_random_sample; struct __pyx_obj_7cytoolz_7recipes_partitionby; struct __pyx_opt_args_7cytoolz_9itertoolz_c_merge_sorted; struct __pyx_opt_args_7cytoolz_9itertoolz_unique; struct __pyx_opt_args_7cytoolz_9itertoolz_get; struct __pyx_opt_args_7cytoolz_9itertoolz_reduceby; struct __pyx_opt_args_7cytoolz_9itertoolz_partition; struct __pyx_opt_args_7cytoolz_9itertoolz_pluck; struct __pyx_opt_args_7cytoolz_9itertoolz_join; struct __pyx_opt_args_7cytoolz_9itertoolz_c_diff; struct __pyx_opt_args_7cytoolz_9itertoolz_topk; /* "cytoolz/itertoolz.pxd":34 * * * cdef object c_merge_sorted(object seqs, object key=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9itertoolz_c_merge_sorted { int __pyx_n; PyObject *key; }; /* "cytoolz/itertoolz.pxd":55 * * * cpdef object unique(object seq, object key=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9itertoolz_unique { int __pyx_n; PyObject *key; }; /* "cytoolz/itertoolz.pxd":91 * * * cpdef object get(object ind, object seq, object default=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9itertoolz_get { int __pyx_n; PyObject *__pyx_default; }; /* "cytoolz/itertoolz.pxd":113 * * * cpdef dict reduceby(object key, object binop, object seq, object init=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9itertoolz_reduceby { int __pyx_n; PyObject *init; }; /* "cytoolz/itertoolz.pxd":128 * * * cpdef object partition(Py_ssize_t n, object seq, object pad=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9itertoolz_partition { int __pyx_n; PyObject *pad; }; /* "cytoolz/itertoolz.pxd":163 * * * cpdef object pluck(object ind, object seqs, object default=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9itertoolz_pluck { int __pyx_n; PyObject *__pyx_default; }; /* "cytoolz/itertoolz.pxd":182 * * * cpdef object join(object leftkey, object leftseq, # <<<<<<<<<<<<<< * object rightkey, object rightseq, * object left_default=*, */ struct __pyx_opt_args_7cytoolz_9itertoolz_join { int __pyx_n; PyObject *left_default; PyObject *right_default; }; /* "cytoolz/itertoolz.pxd":266 * * * cdef object c_diff(object seqs, object default=*, object key=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9itertoolz_c_diff { int __pyx_n; PyObject *__pyx_default; PyObject *key; }; /* "cytoolz/itertoolz.pxd":269 * * * cpdef object topk(Py_ssize_t k, object seq, object key=*) # <<<<<<<<<<<<<< * * */ struct __pyx_opt_args_7cytoolz_9itertoolz_topk { int __pyx_n; PyObject *key; }; /* "cytoolz/itertoolz.pxd":1 * cdef class remove: # <<<<<<<<<<<<<< * cdef object predicate * cdef object iter_seq */ struct __pyx_obj_7cytoolz_9itertoolz_remove { PyObject_HEAD PyObject *predicate; PyObject *iter_seq; }; /* "cytoolz/itertoolz.pxd":6 * * * cdef class accumulate: # <<<<<<<<<<<<<< * cdef object binop * cdef object iter_seq */ struct __pyx_obj_7cytoolz_9itertoolz_accumulate { PyObject_HEAD PyObject *binop; PyObject *iter_seq; PyObject *result; PyObject *initial; }; /* "cytoolz/itertoolz.pxd":16 * * * cdef class _merge_sorted: # <<<<<<<<<<<<<< * cdef object seq1 * cdef object seq2 */ struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted { PyObject_HEAD PyObject *seq1; PyObject *seq2; PyObject *val1; PyObject *val2; Py_ssize_t loop; }; /* "cytoolz/itertoolz.pxd":23 * cdef Py_ssize_t loop * * cdef class _merge_sorted_key: # <<<<<<<<<<<<<< * cdef object seq1 * cdef object seq2 */ struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key { PyObject_HEAD PyObject *seq1; PyObject *seq2; PyObject *val1; PyObject *val2; PyObject *key; PyObject *key1; PyObject *key2; Py_ssize_t loop; }; /* "cytoolz/itertoolz.pxd":37 * * * cdef class interleave: # <<<<<<<<<<<<<< * cdef list iters * cdef list newiters */ struct __pyx_obj_7cytoolz_9itertoolz_interleave { PyObject_HEAD PyObject *iters; PyObject *newiters; Py_ssize_t i; Py_ssize_t n; }; /* "cytoolz/itertoolz.pxd":44 * * * cdef class _unique_key: # <<<<<<<<<<<<<< * cdef object key * cdef object iter_seq */ struct __pyx_obj_7cytoolz_9itertoolz__unique_key { PyObject_HEAD PyObject *key; PyObject *iter_seq; PyObject *seen; }; /* "cytoolz/itertoolz.pxd":50 * * * cdef class _unique_identity: # <<<<<<<<<<<<<< * cdef object iter_seq * cdef object seen */ struct __pyx_obj_7cytoolz_9itertoolz__unique_identity { PyObject_HEAD PyObject *iter_seq; PyObject *seen; }; /* "cytoolz/itertoolz.pxd":103 * * * cdef class interpose: # <<<<<<<<<<<<<< * cdef object el * cdef object iter_seq */ struct __pyx_obj_7cytoolz_9itertoolz_interpose { PyObject_HEAD PyObject *el; PyObject *iter_seq; PyObject *val; int do_el; }; /* "cytoolz/itertoolz.pxd":116 * * * cdef class iterate: # <<<<<<<<<<<<<< * cdef object func * cdef object x */ struct __pyx_obj_7cytoolz_9itertoolz_iterate { PyObject_HEAD PyObject *func; PyObject *x; PyObject *val; }; /* "cytoolz/itertoolz.pxd":122 * * * cdef class sliding_window: # <<<<<<<<<<<<<< * cdef object iterseq * cdef tuple prev */ struct __pyx_obj_7cytoolz_9itertoolz_sliding_window { PyObject_HEAD PyObject *iterseq; PyObject *prev; Py_ssize_t n; }; /* "cytoolz/itertoolz.pxd":131 * * * cdef class partition_all: # <<<<<<<<<<<<<< * cdef Py_ssize_t n * cdef object iterseq */ struct __pyx_obj_7cytoolz_9itertoolz_partition_all { PyObject_HEAD Py_ssize_t n; PyObject *iterseq; }; /* "cytoolz/itertoolz.pxd":139 * * * cdef class _pluck_index: # <<<<<<<<<<<<<< * cdef object ind * cdef object iterseqs */ struct __pyx_obj_7cytoolz_9itertoolz__pluck_index { PyObject_HEAD PyObject *ind; PyObject *iterseqs; }; /* "cytoolz/itertoolz.pxd":144 * * * cdef class _pluck_index_default: # <<<<<<<<<<<<<< * cdef object ind * cdef object iterseqs */ struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default { PyObject_HEAD PyObject *ind; PyObject *iterseqs; PyObject *__pyx_default; }; /* "cytoolz/itertoolz.pxd":150 * * * cdef class _pluck_list: # <<<<<<<<<<<<<< * cdef list ind * cdef object iterseqs */ struct __pyx_obj_7cytoolz_9itertoolz__pluck_list { PyObject_HEAD PyObject *ind; PyObject *iterseqs; Py_ssize_t n; }; /* "cytoolz/itertoolz.pxd":156 * * * cdef class _pluck_list_default: # <<<<<<<<<<<<<< * cdef list ind * cdef object iterseqs */ struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default { PyObject_HEAD PyObject *ind; PyObject *iterseqs; PyObject *__pyx_default; Py_ssize_t n; }; /* "cytoolz/itertoolz.pxd":166 * * * cdef class _getter_index: # <<<<<<<<<<<<<< * cdef object ind * */ struct __pyx_obj_7cytoolz_9itertoolz__getter_index { PyObject_HEAD PyObject *ind; }; /* "cytoolz/itertoolz.pxd":170 * * * cdef class _getter_list: # <<<<<<<<<<<<<< * cdef list ind * cdef Py_ssize_t n */ struct __pyx_obj_7cytoolz_9itertoolz__getter_list { PyObject_HEAD PyObject *ind; Py_ssize_t n; }; /* "cytoolz/itertoolz.pxd":175 * * * cdef class _getter_null: # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__getter_null { PyObject_HEAD }; /* "cytoolz/itertoolz.pxd":187 * object right_default=*) * * cdef class _join: # <<<<<<<<<<<<<< * cdef dict d * cdef list matches */ struct __pyx_obj_7cytoolz_9itertoolz__join { PyObject_HEAD struct __pyx_vtabstruct_7cytoolz_9itertoolz__join *__pyx_vtab; PyObject *d; PyObject *matches; PyObject *seen_keys; PyObject *leftseq; PyObject *rightseq; PyObject *_rightkey; PyObject *right; PyObject *left_default; PyObject *right_default; PyObject *keys; Py_ssize_t N; Py_ssize_t i; int is_rightseq_exhausted; }; /* "cytoolz/itertoolz.pxd":205 * * * cdef class _inner_join(_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__inner_join { struct __pyx_obj_7cytoolz_9itertoolz__join __pyx_base; }; /* "cytoolz/itertoolz.pxd":208 * pass * * cdef class _right_outer_join(_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join { struct __pyx_obj_7cytoolz_9itertoolz__join __pyx_base; }; /* "cytoolz/itertoolz.pxd":211 * pass * * cdef class _left_outer_join(_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join { struct __pyx_obj_7cytoolz_9itertoolz__join __pyx_base; }; /* "cytoolz/itertoolz.pxd":214 * pass * * cdef class _outer_join(_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__outer_join { struct __pyx_obj_7cytoolz_9itertoolz__join __pyx_base; }; /* "cytoolz/itertoolz.pxd":218 * * * cdef class _inner_join_key(_inner_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key { struct __pyx_obj_7cytoolz_9itertoolz__inner_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":221 * pass * * cdef class _inner_join_index(_inner_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index { struct __pyx_obj_7cytoolz_9itertoolz__inner_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":224 * pass * * cdef class _inner_join_indices(_inner_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices { struct __pyx_obj_7cytoolz_9itertoolz__inner_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":227 * pass * * cdef class _right_outer_join_key(_right_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key { struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":230 * pass * * cdef class _right_outer_join_index(_right_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index { struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":233 * pass * * cdef class _right_outer_join_indices(_right_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices { struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":236 * pass * * cdef class _left_outer_join_key(_left_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key { struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":239 * pass * * cdef class _left_outer_join_index(_left_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index { struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":242 * pass * * cdef class _left_outer_join_indices(_left_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices { struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":245 * pass * * cdef class _outer_join_key(_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key { struct __pyx_obj_7cytoolz_9itertoolz__outer_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":248 * pass * * cdef class _outer_join_index(_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index { struct __pyx_obj_7cytoolz_9itertoolz__outer_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":251 * pass * * cdef class _outer_join_indices(_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices { struct __pyx_obj_7cytoolz_9itertoolz__outer_join __pyx_base; }; /* "cytoolz/itertoolz.pxd":255 * * * cdef class _diff_key: # <<<<<<<<<<<<<< * cdef Py_ssize_t N * cdef object iters */ struct __pyx_obj_7cytoolz_9itertoolz__diff_key { PyObject_HEAD Py_ssize_t N; PyObject *iters; PyObject *key; }; /* "cytoolz/itertoolz.pxd":261 * * * cdef class _diff_identity: # <<<<<<<<<<<<<< * cdef Py_ssize_t N * cdef object iters */ struct __pyx_obj_7cytoolz_9itertoolz__diff_identity { PyObject_HEAD Py_ssize_t N; PyObject *iters; }; /* "cytoolz/itertoolz.pxd":278 * * * cdef class random_sample: # <<<<<<<<<<<<<< * cdef object iter_seq * cdef object prob */ struct __pyx_obj_7cytoolz_9itertoolz_random_sample { PyObject_HEAD PyObject *iter_seq; PyObject *prob; PyObject *random_func; }; /* "cytoolz/recipes.pxd":4 * * * cdef class partitionby: # <<<<<<<<<<<<<< * cdef object iter_groupby */ struct __pyx_obj_7cytoolz_7recipes_partitionby { PyObject_HEAD PyObject *iter_groupby; }; /* "cytoolz/itertoolz.pxd":187 * object right_default=*) * * cdef class _join: # <<<<<<<<<<<<<< * cdef dict d * cdef list matches */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__join { PyObject *(*rightkey)(struct __pyx_obj_7cytoolz_9itertoolz__join *); }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__join *__pyx_vtabptr_7cytoolz_9itertoolz__join; /* "cytoolz/itertoolz.pxd":205 * * * cdef class _inner_join(_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join { struct __pyx_vtabstruct_7cytoolz_9itertoolz__join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join *__pyx_vtabptr_7cytoolz_9itertoolz__inner_join; /* "cytoolz/itertoolz.pxd":208 * pass * * cdef class _right_outer_join(_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join { struct __pyx_vtabstruct_7cytoolz_9itertoolz__join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join *__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join; /* "cytoolz/itertoolz.pxd":211 * pass * * cdef class _left_outer_join(_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join { struct __pyx_vtabstruct_7cytoolz_9itertoolz__join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join *__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join; /* "cytoolz/itertoolz.pxd":214 * pass * * cdef class _outer_join(_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join { struct __pyx_vtabstruct_7cytoolz_9itertoolz__join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join *__pyx_vtabptr_7cytoolz_9itertoolz__outer_join; /* "cytoolz/itertoolz.pxd":218 * * * cdef class _inner_join_key(_inner_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_key { struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_key *__pyx_vtabptr_7cytoolz_9itertoolz__inner_join_key; /* "cytoolz/itertoolz.pxd":221 * pass * * cdef class _inner_join_index(_inner_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_index { struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_index *__pyx_vtabptr_7cytoolz_9itertoolz__inner_join_index; /* "cytoolz/itertoolz.pxd":224 * pass * * cdef class _inner_join_indices(_inner_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_indices { struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_indices *__pyx_vtabptr_7cytoolz_9itertoolz__inner_join_indices; /* "cytoolz/itertoolz.pxd":227 * pass * * cdef class _right_outer_join_key(_right_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_key { struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_key *__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_key; /* "cytoolz/itertoolz.pxd":230 * pass * * cdef class _right_outer_join_index(_right_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_index { struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_index *__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_index; /* "cytoolz/itertoolz.pxd":233 * pass * * cdef class _right_outer_join_indices(_right_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_indices { struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_indices *__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_indices; /* "cytoolz/itertoolz.pxd":236 * pass * * cdef class _left_outer_join_key(_left_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_key { struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_key *__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_key; /* "cytoolz/itertoolz.pxd":239 * pass * * cdef class _left_outer_join_index(_left_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_index { struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_index *__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_index; /* "cytoolz/itertoolz.pxd":242 * pass * * cdef class _left_outer_join_indices(_left_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_indices { struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_indices *__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_indices; /* "cytoolz/itertoolz.pxd":245 * pass * * cdef class _outer_join_key(_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_key { struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_key *__pyx_vtabptr_7cytoolz_9itertoolz__outer_join_key; /* "cytoolz/itertoolz.pxd":248 * pass * * cdef class _outer_join_index(_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_index { struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_index *__pyx_vtabptr_7cytoolz_9itertoolz__outer_join_index; /* "cytoolz/itertoolz.pxd":251 * pass * * cdef class _outer_join_indices(_outer_join): # <<<<<<<<<<<<<< * pass * */ struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_indices { struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join __pyx_base; }; static struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_indices *__pyx_vtabptr_7cytoolz_9itertoolz__outer_join_indices; /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #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); #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 #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) /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* CallableCheck.proto */ #if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3 #define __Pyx_PyCallable_Check(obj) ((obj)->ob_type->tp_call != NULL) #else #define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj) #endif /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } #define __Pyx_GetModuleGlobalNameUncached(var, name) {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif /* PyCFunctionFastCall.proto */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); #else #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() PyErr_Occurred() #endif /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* IterNext.proto */ #define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL) static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *); /* RaiseTooManyValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); /* RaiseNeedMoreValuesToUnpack.proto */ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); /* IterFinish.proto */ static CYTHON_INLINE int __Pyx_IterFinish(void); /* UnpackItemEndCheck.proto */ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /* RaiseException.proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /* PyObject_GenericGetAttrNoDict.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr #endif /* PyObject_GenericGetAttr.proto */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr #endif /* SetupReduce.proto */ static int __Pyx_setup_reduce(PyObject* type_obj); /* TypeImport.proto */ #ifndef __PYX_HAVE_RT_ImportType_proto #define __PYX_HAVE_RT_ImportType_proto enum __Pyx_ImportType_CheckSize { __Pyx_ImportType_CheckSize_Error = 0, __Pyx_ImportType_CheckSize_Warn = 1, __Pyx_ImportType_CheckSize_Ignore = 2 }; static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size); #endif /* GetVTable.proto */ static void* __Pyx_GetVtable(PyObject *dict); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* FetchCommonType.proto */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); /* CythonFunction.proto */ #define __Pyx_CyFunction_USED 1 #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; #if PY_VERSION_HEX < 0x030500A0 PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; void *defaults; int defaults_pyobjects; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) #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); /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; int code_line; } __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); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* FunctionImport.proto */ static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'libc.string' */ /* Module declarations from 'libc.stdio' */ /* Module declarations from '__builtin__' */ /* Module declarations from 'cpython.type' */ static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; /* Module declarations from 'cpython' */ /* Module declarations from 'cpython.object' */ /* Module declarations from 'cpython.sequence' */ /* Module declarations from 'cytoolz.itertoolz' */ static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_remove = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_accumulate = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__merge_sorted = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__merge_sorted_key = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_interleave = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__unique_key = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__unique_identity = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_interpose = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_iterate = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_sliding_window = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_partition_all = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__pluck_index = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__pluck_index_default = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__pluck_list = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__pluck_list_default = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__getter_index = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__getter_list = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__getter_null = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__join = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__inner_join = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__right_outer_join = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__left_outer_join = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__outer_join = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__inner_join_key = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__inner_join_index = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__inner_join_indices = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__right_outer_join_key = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__right_outer_join_index = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__right_outer_join_indices = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__left_outer_join_key = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__left_outer_join_index = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__left_outer_join_indices = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__outer_join_key = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__outer_join_index = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__outer_join_indices = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__diff_key = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz__diff_identity = 0; static PyTypeObject *__pyx_ptype_7cytoolz_9itertoolz_random_sample = 0; static PyObject *(*__pyx_f_7cytoolz_9itertoolz_frequencies)(PyObject *, int __pyx_skip_dispatch); /*proto*/ static PyObject *(*__pyx_f_7cytoolz_9itertoolz_pluck)(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_pluck *__pyx_optional_args); /*proto*/ /* Module declarations from 'cytoolz.recipes' */ static PyTypeObject *__pyx_ptype_7cytoolz_7recipes_partitionby = 0; static PyObject *__pyx_f_7cytoolz_7recipes_countby(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/ #define __Pyx_MODULE_NAME "cytoolz.recipes" extern int __pyx_module_is_main_cytoolz__recipes; int __pyx_module_is_main_cytoolz__recipes = 0; /* Implementation of 'cytoolz.recipes' */ static PyObject *__pyx_builtin_TypeError; static const char __pyx_k_all[] = "__all__"; static const char __pyx_k_key[] = "key"; static const char __pyx_k_map[] = "map"; static const char __pyx_k_seq[] = "seq"; static const char __pyx_k_func[] = "func"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_self[] = "self"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_reduce[] = "__reduce__"; static const char __pyx_k_countby[] = "countby"; static const char __pyx_k_groupby[] = "groupby"; static const char __pyx_k_getstate[] = "__getstate__"; static const char __pyx_k_setstate[] = "__setstate__"; static const char __pyx_k_TypeError[] = "TypeError"; static const char __pyx_k_itertools[] = "itertools"; static const char __pyx_k_pyx_state[] = "__pyx_state"; static const char __pyx_k_reduce_ex[] = "__reduce_ex__"; static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__"; static const char __pyx_k_partitionby[] = "partitionby"; static const char __pyx_k_stringsource[] = "stringsource"; static const char __pyx_k_reduce_cython[] = "__reduce_cython__"; static const char __pyx_k_countby_line_11[] = "countby (line 11)"; static const char __pyx_k_cytoolz_recipes[] = "cytoolz.recipes"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_cytoolz_recipes_pyx[] = "cytoolz/recipes.pyx"; static const char __pyx_k_cytoolz_compatibility[] = "cytoolz.compatibility"; static const char __pyx_k_partitionby___reduce_cython[] = "partitionby.__reduce_cython__"; static const char __pyx_k_partitionby___setstate_cython[] = "partitionby.__setstate_cython__"; static const char __pyx_k_Count_elements_of_a_collection[] = "\n Count elements of a collection by a key function\n\n >>> countby(len, ['cat', 'mouse', 'dog'])\n {3: 2, 5: 1}\n\n >>> def iseven(x): return x % 2 == 0\n >>> countby(iseven, [1, 2, 3]) # doctest:+SKIP\n {True: 1, False: 2}\n\n See Also:\n groupby\n "; static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__"; static PyObject *__pyx_kp_u_Count_elements_of_a_collection; static PyObject *__pyx_n_s_TypeError; static PyObject *__pyx_n_s_all; static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_countby; static PyObject *__pyx_kp_u_countby_line_11; static PyObject *__pyx_n_s_cytoolz_compatibility; static PyObject *__pyx_n_s_cytoolz_recipes; static PyObject *__pyx_kp_s_cytoolz_recipes_pyx; static PyObject *__pyx_n_s_func; static PyObject *__pyx_n_s_getstate; static PyObject *__pyx_n_s_groupby; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_itertools; static PyObject *__pyx_n_s_key; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_map; static PyObject *__pyx_n_s_name; static PyObject *__pyx_kp_s_no_default___reduce___due_to_non; static PyObject *__pyx_n_s_partitionby; static PyObject *__pyx_n_s_partitionby___reduce_cython; static PyObject *__pyx_n_s_partitionby___setstate_cython; static PyObject *__pyx_n_s_pyx_state; static PyObject *__pyx_n_s_pyx_vtable; static PyObject *__pyx_n_s_reduce; static PyObject *__pyx_n_s_reduce_cython; static PyObject *__pyx_n_s_reduce_ex; static PyObject *__pyx_n_s_self; static PyObject *__pyx_n_s_seq; static PyObject *__pyx_n_s_setstate; static PyObject *__pyx_n_s_setstate_cython; static PyObject *__pyx_kp_s_stringsource; static PyObject *__pyx_n_s_test; static PyObject *__pyx_pf_7cytoolz_7recipes_countby(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_seq); /* proto */ static int __pyx_pf_7cytoolz_7recipes_11partitionby___cinit__(struct __pyx_obj_7cytoolz_7recipes_partitionby *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_pf_7cytoolz_7recipes_11partitionby_2__iter__(struct __pyx_obj_7cytoolz_7recipes_partitionby *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_7recipes_11partitionby_4__next__(struct __pyx_obj_7cytoolz_7recipes_partitionby *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_7recipes_11partitionby_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_7recipes_partitionby *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_7recipes_11partitionby_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_7recipes_partitionby *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_tp_new_7cytoolz_7recipes_partitionby(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__2; static PyObject *__pyx_tuple__3; static PyObject *__pyx_tuple__5; static PyObject *__pyx_tuple__7; static PyObject *__pyx_codeobj__4; static PyObject *__pyx_codeobj__6; static PyObject *__pyx_codeobj__8; /* Late includes */ /* "cytoolz/recipes.pyx":11 * * * cpdef object countby(object key, object seq): # <<<<<<<<<<<<<< * """ * Count elements of a collection by a key function */ static PyObject *__pyx_pw_7cytoolz_7recipes_1countby(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_7cytoolz_7recipes_countby(PyObject *__pyx_v_key, PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) { 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_t_6; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("countby", 0); /* "cytoolz/recipes.pyx":25 * groupby * """ * if not callable(key): # <<<<<<<<<<<<<< * return frequencies(pluck(key, seq)) * return frequencies(map(key, seq)) */ __pyx_t_1 = __Pyx_PyCallable_Check(__pyx_v_key); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 25, __pyx_L1_error) __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); if (__pyx_t_2) { /* "cytoolz/recipes.pyx":26 * """ * if not callable(key): * return frequencies(pluck(key, seq)) # <<<<<<<<<<<<<< * return frequencies(map(key, seq)) * */ __Pyx_XDECREF(__pyx_r); __pyx_t_3 = __pyx_f_7cytoolz_9itertoolz_pluck(__pyx_v_key, __pyx_v_seq, 0, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 26, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_f_7cytoolz_9itertoolz_frequencies(__pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 26, __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; /* "cytoolz/recipes.pyx":25 * groupby * """ * if not callable(key): # <<<<<<<<<<<<<< * return frequencies(pluck(key, seq)) * return frequencies(map(key, seq)) */ } /* "cytoolz/recipes.pyx":27 * if not callable(key): * return frequencies(pluck(key, seq)) * return frequencies(map(key, seq)) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_map); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_6 = 0; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_5)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_5); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_v_seq}; __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) { PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_v_seq}; __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_GOTREF(__pyx_t_4); } else #endif { __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_5) { __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL; } __Pyx_INCREF(__pyx_v_key); __Pyx_GIVEREF(__pyx_v_key); PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_key); __Pyx_INCREF(__pyx_v_seq); __Pyx_GIVEREF(__pyx_v_seq); PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_seq); __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 27, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = __pyx_f_7cytoolz_9itertoolz_frequencies(__pyx_t_4, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 27, __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; /* "cytoolz/recipes.pyx":11 * * * cpdef object countby(object key, object seq): # <<<<<<<<<<<<<< * """ * Count elements of a collection by a key function */ /* 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_7); __Pyx_AddTraceback("cytoolz.recipes.countby", __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_7cytoolz_7recipes_1countby(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_7recipes_countby[] = "countby(key, seq)\n\n Count elements of a collection by a key function\n\n >>> countby(len, ['cat', 'mouse', 'dog'])\n {3: 2, 5: 1}\n\n >>> def iseven(x): return x % 2 == 0\n >>> countby(iseven, [1, 2, 3]) # doctest:+SKIP\n {True: 1, False: 2}\n\n See Also:\n groupby\n "; static PyMethodDef __pyx_mdef_7cytoolz_7recipes_1countby = {"countby", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_7recipes_1countby, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_7recipes_countby}; static PyObject *__pyx_pw_7cytoolz_7recipes_1countby(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_key = 0; PyObject *__pyx_v_seq = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("countby (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_seq,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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("countby", 1, 2, 2, 1); __PYX_ERR(1, 11, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "countby") < 0)) __PYX_ERR(1, 11, __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_seq = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("countby", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 11, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.recipes.countby", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_7recipes_countby(__pyx_self, __pyx_v_key, __pyx_v_seq); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_7recipes_countby(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_seq) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("countby", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_7recipes_countby(__pyx_v_key, __pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.recipes.countby", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/recipes.pyx":52 * itertools.groupby * """ * def __cinit__(self, object func, object seq): # <<<<<<<<<<<<<< * self.iter_groupby = groupby(seq, key=func) * */ /* Python wrapper */ static int __pyx_pw_7cytoolz_7recipes_11partitionby_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pw_7cytoolz_7recipes_11partitionby_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_func = 0; PyObject *__pyx_v_seq = 0; int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_seq,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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_seq)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(1, 52, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 52, __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_func = values[0]; __pyx_v_seq = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 52, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.recipes.partitionby.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_7recipes_11partitionby___cinit__(((struct __pyx_obj_7cytoolz_7recipes_partitionby *)__pyx_v_self), __pyx_v_func, __pyx_v_seq); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static int __pyx_pf_7cytoolz_7recipes_11partitionby___cinit__(struct __pyx_obj_7cytoolz_7recipes_partitionby *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_seq) { 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; __Pyx_RefNannySetupContext("__cinit__", 0); /* "cytoolz/recipes.pyx":53 * """ * def __cinit__(self, object func, object seq): * self.iter_groupby = groupby(seq, key=func) # <<<<<<<<<<<<<< * * def __iter__(self): */ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_groupby); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_seq); __Pyx_GIVEREF(__pyx_v_seq); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seq); __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_v_func) < 0) __PYX_ERR(1, 53, __pyx_L1_error) __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 53, __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_GIVEREF(__pyx_t_4); __Pyx_GOTREF(__pyx_v_self->iter_groupby); __Pyx_DECREF(__pyx_v_self->iter_groupby); __pyx_v_self->iter_groupby = __pyx_t_4; __pyx_t_4 = 0; /* "cytoolz/recipes.pyx":52 * itertools.groupby * """ * def __cinit__(self, object func, object seq): # <<<<<<<<<<<<<< * self.iter_groupby = groupby(seq, key=func) * */ /* 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("cytoolz.recipes.partitionby.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/recipes.pyx":55 * self.iter_groupby = groupby(seq, key=func) * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_7recipes_11partitionby_3__iter__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_7recipes_11partitionby_3__iter__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_7recipes_11partitionby_2__iter__(((struct __pyx_obj_7cytoolz_7recipes_partitionby *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_7recipes_11partitionby_2__iter__(struct __pyx_obj_7cytoolz_7recipes_partitionby *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__iter__", 0); /* "cytoolz/recipes.pyx":56 * * 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; /* "cytoolz/recipes.pyx":55 * self.iter_groupby = groupby(seq, key=func) * * def __iter__(self): # <<<<<<<<<<<<<< * return self * */ /* function exit code */ __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/recipes.pyx":58 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef object key, val * key, val = next(self.iter_groupby) */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_7recipes_11partitionby_5__next__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pw_7cytoolz_7recipes_11partitionby_5__next__(PyObject *__pyx_v_self) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__next__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_7recipes_11partitionby_4__next__(((struct __pyx_obj_7cytoolz_7recipes_partitionby *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_7recipes_11partitionby_4__next__(struct __pyx_obj_7cytoolz_7recipes_partitionby *__pyx_v_self) { CYTHON_UNUSED PyObject *__pyx_v_key = 0; PyObject *__pyx_v_val = 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)(PyObject *); __Pyx_RefNannySetupContext("__next__", 0); /* "cytoolz/recipes.pyx":60 * def __next__(self): * cdef object key, val * key, val = next(self.iter_groupby) # <<<<<<<<<<<<<< * return PySequence_Tuple(val) */ __pyx_t_1 = __pyx_v_self->iter_groupby; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyIter_Next(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 60, __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; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); __PYX_ERR(1, 60, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 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_ERR(1, 60, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 60, __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_ERR(1, 60, __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_ERR(1, 60, __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_ERR(1, 60, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_key = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_val = __pyx_t_3; __pyx_t_3 = 0; /* "cytoolz/recipes.pyx":61 * cdef object key, val * key, val = next(self.iter_groupby) * return PySequence_Tuple(val) # <<<<<<<<<<<<<< */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PySequence_Tuple(__pyx_v_val); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 61, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; /* "cytoolz/recipes.pyx":58 * return self * * def __next__(self): # <<<<<<<<<<<<<< * cdef object key, val * key, val = next(self.iter_groupby) */ /* 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("cytoolz.recipes.partitionby.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_key); __Pyx_XDECREF(__pyx_v_val); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_7recipes_11partitionby_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_7recipes_11partitionby_6__reduce_cython__[] = "partitionby.__reduce_cython__(self)"; static PyMethodDef __pyx_mdef_7cytoolz_7recipes_11partitionby_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_7recipes_11partitionby_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_7recipes_11partitionby_6__reduce_cython__}; static PyObject *__pyx_pw_7cytoolz_7recipes_11partitionby_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_7recipes_11partitionby_6__reduce_cython__(((struct __pyx_obj_7cytoolz_7recipes_partitionby *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_7recipes_11partitionby_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_7recipes_partitionby *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__reduce_cython__", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __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_ERR(0, 2, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.recipes.partitionby.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_7recipes_11partitionby_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/ static char __pyx_doc_7cytoolz_7recipes_11partitionby_8__setstate_cython__[] = "partitionby.__setstate_cython__(self, __pyx_state)"; static PyMethodDef __pyx_mdef_7cytoolz_7recipes_11partitionby_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_7recipes_11partitionby_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_7recipes_11partitionby_8__setstate_cython__}; static PyObject *__pyx_pw_7cytoolz_7recipes_11partitionby_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_7recipes_11partitionby_8__setstate_cython__(((struct __pyx_obj_7cytoolz_7recipes_partitionby *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_7recipes_11partitionby_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7cytoolz_7recipes_partitionby *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__setstate_cython__", 0); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __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_ERR(0, 4, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("cytoolz.recipes.partitionby.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_7cytoolz_7recipes_partitionby(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_7cytoolz_7recipes_partitionby *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_7cytoolz_7recipes_partitionby *)o); p->iter_groupby = Py_None; Py_INCREF(Py_None); if (unlikely(__pyx_pw_7cytoolz_7recipes_11partitionby_1__cinit__(o, a, k) < 0)) goto bad; return o; bad: Py_DECREF(o); o = 0; return NULL; } static void __pyx_tp_dealloc_7cytoolz_7recipes_partitionby(PyObject *o) { struct __pyx_obj_7cytoolz_7recipes_partitionby *p = (struct __pyx_obj_7cytoolz_7recipes_partitionby *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { if (PyObject_CallFinalizerFromDealloc(o)) return; } #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->iter_groupby); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_7cytoolz_7recipes_partitionby(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_7cytoolz_7recipes_partitionby *p = (struct __pyx_obj_7cytoolz_7recipes_partitionby *)o; if (p->iter_groupby) { e = (*v)(p->iter_groupby, a); if (e) return e; } return 0; } static int __pyx_tp_clear_7cytoolz_7recipes_partitionby(PyObject *o) { PyObject* tmp; struct __pyx_obj_7cytoolz_7recipes_partitionby *p = (struct __pyx_obj_7cytoolz_7recipes_partitionby *)o; tmp = ((PyObject*)p->iter_groupby); p->iter_groupby = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_specialmethod___pyx_pw_7cytoolz_7recipes_11partitionby_5__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7cytoolz_7recipes_11partitionby_5__next__(self);} static PyMethodDef __pyx_methods_7cytoolz_7recipes_partitionby[] = { {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7cytoolz_7recipes_11partitionby_5__next__, METH_NOARGS|METH_COEXIST, 0}, {"__reduce_cython__", (PyCFunction)__pyx_pw_7cytoolz_7recipes_11partitionby_7__reduce_cython__, METH_NOARGS, __pyx_doc_7cytoolz_7recipes_11partitionby_6__reduce_cython__}, {"__setstate_cython__", (PyCFunction)__pyx_pw_7cytoolz_7recipes_11partitionby_9__setstate_cython__, METH_O, __pyx_doc_7cytoolz_7recipes_11partitionby_8__setstate_cython__}, {0, 0, 0, 0} }; static PyTypeObject __pyx_type_7cytoolz_7recipes_partitionby = { PyVarObject_HEAD_INIT(0, 0) "cytoolz.recipes.partitionby", /*tp_name*/ sizeof(struct __pyx_obj_7cytoolz_7recipes_partitionby), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_7cytoolz_7recipes_partitionby, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif #if PY_VERSION_HEX >= 0x030800b4 0, /*tp_vectorcall_offset*/ #endif 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #endif #if PY_MAJOR_VERSION >= 3 0, /*tp_as_async*/ #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*/ " partitionby(func, seq)\n\n Partition a sequence according to a function\n\n Partition `s` into a sequence of lists such that, when traversing\n `s`, every time the output of `func` changes a new list is started\n and that and subsequent items are collected into that list.\n\n >>> is_space = lambda c: c == \" \"\n >>> list(partitionby(is_space, \"I have space\"))\n [('I',), (' ',), ('h', 'a', 'v', 'e'), (' ',), ('s', 'p', 'a', 'c', 'e')]\n\n >>> is_large = lambda x: x > 10\n >>> list(partitionby(is_large, [1, 2, 1, 99, 88, 33, 99, -1, 5]))\n [(1, 2, 1), (99, 88, 33, 99), (-1, 5)]\n\n See also:\n partition\n groupby\n itertools.groupby\n ", /*tp_doc*/ __pyx_tp_traverse_7cytoolz_7recipes_partitionby, /*tp_traverse*/ __pyx_tp_clear_7cytoolz_7recipes_partitionby, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ __pyx_pw_7cytoolz_7recipes_11partitionby_3__iter__, /*tp_iter*/ __pyx_pw_7cytoolz_7recipes_11partitionby_5__next__, /*tp_iternext*/ __pyx_methods_7cytoolz_7recipes_partitionby, /*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_7cytoolz_7recipes_partitionby, /*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*/ 0, /*tp_version_tag*/ #if PY_VERSION_HEX >= 0x030400a1 0, /*tp_finalize*/ #endif #if PY_VERSION_HEX >= 0x030800b1 0, /*tp_vectorcall*/ #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, /*tp_print*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_recipes(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_recipes}, {0, NULL} }; #endif static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, "recipes", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_u_Count_elements_of_a_collection, __pyx_k_Count_elements_of_a_collection, sizeof(__pyx_k_Count_elements_of_a_collection), 0, 1, 0, 0}, {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1}, {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_countby, __pyx_k_countby, sizeof(__pyx_k_countby), 0, 0, 1, 1}, {&__pyx_kp_u_countby_line_11, __pyx_k_countby_line_11, sizeof(__pyx_k_countby_line_11), 0, 1, 0, 0}, {&__pyx_n_s_cytoolz_compatibility, __pyx_k_cytoolz_compatibility, sizeof(__pyx_k_cytoolz_compatibility), 0, 0, 1, 1}, {&__pyx_n_s_cytoolz_recipes, __pyx_k_cytoolz_recipes, sizeof(__pyx_k_cytoolz_recipes), 0, 0, 1, 1}, {&__pyx_kp_s_cytoolz_recipes_pyx, __pyx_k_cytoolz_recipes_pyx, sizeof(__pyx_k_cytoolz_recipes_pyx), 0, 0, 1, 0}, {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1}, {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1}, {&__pyx_n_s_groupby, __pyx_k_groupby, sizeof(__pyx_k_groupby), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1}, {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0}, {&__pyx_n_s_partitionby, __pyx_k_partitionby, sizeof(__pyx_k_partitionby), 0, 0, 1, 1}, {&__pyx_n_s_partitionby___reduce_cython, __pyx_k_partitionby___reduce_cython, sizeof(__pyx_k_partitionby___reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_partitionby___setstate_cython, __pyx_k_partitionby___setstate_cython, sizeof(__pyx_k_partitionby___setstate_cython), 0, 0, 1, 1}, {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 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_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1}, {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1}, {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1}, {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, {&__pyx_n_s_seq, __pyx_k_seq, sizeof(__pyx_k_seq), 0, 0, 1, 1}, {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1}, {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1}, {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "(tree fragment)":2 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); /* "(tree fragment)":4 * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<< */ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); /* "cytoolz/recipes.pyx":11 * * * cpdef object countby(object key, object seq): # <<<<<<<<<<<<<< * """ * Count elements of a collection by a key function */ __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_key, __pyx_n_s_seq); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_recipes_pyx, __pyx_n_s_countby, 11, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(1, 11, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__5); __Pyx_GIVEREF(__pyx_tuple__5); __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 1, __pyx_L1_error) /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__7); __Pyx_GIVEREF(__pyx_tuple__7); __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error); return 0; __pyx_L1_error:; return -1; } static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ if (__Pyx_ExportFunction("countby", (void (*)(void))__pyx_f_7cytoolz_7recipes_countby, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_7cytoolz_7recipes_partitionby) < 0) __PYX_ERR(1, 30, __pyx_L1_error) #if PY_VERSION_HEX < 0x030800B1 __pyx_type_7cytoolz_7recipes_partitionby.tp_print = 0; #endif if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7cytoolz_7recipes_partitionby.tp_dictoffset && __pyx_type_7cytoolz_7recipes_partitionby.tp_getattro == PyObject_GenericGetAttr)) { __pyx_type_7cytoolz_7recipes_partitionby.tp_getattro = __Pyx_PyObject_GenericGetAttr; } if (PyObject_SetAttr(__pyx_m, __pyx_n_s_partitionby, (PyObject *)&__pyx_type_7cytoolz_7recipes_partitionby) < 0) __PYX_ERR(1, 30, __pyx_L1_error) if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7cytoolz_7recipes_partitionby) < 0) __PYX_ERR(1, 30, __pyx_L1_error) __pyx_ptype_7cytoolz_7recipes_partitionby = &__pyx_type_7cytoolz_7recipes_partitionby; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type", #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000 sizeof(PyTypeObject), #else sizeof(PyHeapTypeObject), #endif __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyImport_ImportModule("cytoolz.itertoolz"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_ptype_7cytoolz_9itertoolz_remove = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "remove", sizeof(struct __pyx_obj_7cytoolz_9itertoolz_remove), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz_remove) __PYX_ERR(3, 1, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz_accumulate = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "accumulate", sizeof(struct __pyx_obj_7cytoolz_9itertoolz_accumulate), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz_accumulate) __PYX_ERR(3, 6, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__merge_sorted = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_merge_sorted", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__merge_sorted) __PYX_ERR(3, 16, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__merge_sorted_key = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_merge_sorted_key", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__merge_sorted_key), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__merge_sorted_key) __PYX_ERR(3, 23, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz_interleave = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "interleave", sizeof(struct __pyx_obj_7cytoolz_9itertoolz_interleave), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz_interleave) __PYX_ERR(3, 37, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__unique_key = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_unique_key", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__unique_key), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__unique_key) __PYX_ERR(3, 44, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__unique_identity = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_unique_identity", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__unique_identity), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__unique_identity) __PYX_ERR(3, 50, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz_interpose = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "interpose", sizeof(struct __pyx_obj_7cytoolz_9itertoolz_interpose), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz_interpose) __PYX_ERR(3, 103, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz_iterate = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "iterate", sizeof(struct __pyx_obj_7cytoolz_9itertoolz_iterate), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz_iterate) __PYX_ERR(3, 116, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz_sliding_window = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "sliding_window", sizeof(struct __pyx_obj_7cytoolz_9itertoolz_sliding_window), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz_sliding_window) __PYX_ERR(3, 122, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz_partition_all = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "partition_all", sizeof(struct __pyx_obj_7cytoolz_9itertoolz_partition_all), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz_partition_all) __PYX_ERR(3, 131, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__pluck_index = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_pluck_index", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__pluck_index) __PYX_ERR(3, 139, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__pluck_index_default = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_pluck_index_default", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__pluck_index_default), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__pluck_index_default) __PYX_ERR(3, 144, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__pluck_list = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_pluck_list", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__pluck_list) __PYX_ERR(3, 150, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__pluck_list_default = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_pluck_list_default", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__pluck_list_default), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__pluck_list_default) __PYX_ERR(3, 156, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__getter_index = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_getter_index", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__getter_index), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__getter_index) __PYX_ERR(3, 166, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__getter_list = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_getter_list", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__getter_list), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__getter_list) __PYX_ERR(3, 170, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__getter_null = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_getter_null", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__getter_null), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__getter_null) __PYX_ERR(3, 175, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__join = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_join", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__join), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__join) __PYX_ERR(3, 187, __pyx_L1_error) __pyx_vtabptr_7cytoolz_9itertoolz__join = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__join*)__Pyx_GetVtable(__pyx_ptype_7cytoolz_9itertoolz__join->tp_dict); if (unlikely(!__pyx_vtabptr_7cytoolz_9itertoolz__join)) __PYX_ERR(3, 187, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__inner_join = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_inner_join", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__inner_join), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__inner_join) __PYX_ERR(3, 205, __pyx_L1_error) __pyx_vtabptr_7cytoolz_9itertoolz__inner_join = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join*)__Pyx_GetVtable(__pyx_ptype_7cytoolz_9itertoolz__inner_join->tp_dict); if (unlikely(!__pyx_vtabptr_7cytoolz_9itertoolz__inner_join)) __PYX_ERR(3, 205, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__right_outer_join = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_right_outer_join", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__right_outer_join) __PYX_ERR(3, 208, __pyx_L1_error) __pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join*)__Pyx_GetVtable(__pyx_ptype_7cytoolz_9itertoolz__right_outer_join->tp_dict); if (unlikely(!__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join)) __PYX_ERR(3, 208, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__left_outer_join = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_left_outer_join", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__left_outer_join) __PYX_ERR(3, 211, __pyx_L1_error) __pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join*)__Pyx_GetVtable(__pyx_ptype_7cytoolz_9itertoolz__left_outer_join->tp_dict); if (unlikely(!__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join)) __PYX_ERR(3, 211, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__outer_join = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_outer_join", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__outer_join), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__outer_join) __PYX_ERR(3, 214, __pyx_L1_error) __pyx_vtabptr_7cytoolz_9itertoolz__outer_join = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join*)__Pyx_GetVtable(__pyx_ptype_7cytoolz_9itertoolz__outer_join->tp_dict); if (unlikely(!__pyx_vtabptr_7cytoolz_9itertoolz__outer_join)) __PYX_ERR(3, 214, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__inner_join_key = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_inner_join_key", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__inner_join_key), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__inner_join_key) __PYX_ERR(3, 218, __pyx_L1_error) __pyx_vtabptr_7cytoolz_9itertoolz__inner_join_key = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_key*)__Pyx_GetVtable(__pyx_ptype_7cytoolz_9itertoolz__inner_join_key->tp_dict); if (unlikely(!__pyx_vtabptr_7cytoolz_9itertoolz__inner_join_key)) __PYX_ERR(3, 218, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__inner_join_index = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_inner_join_index", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__inner_join_index), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__inner_join_index) __PYX_ERR(3, 221, __pyx_L1_error) __pyx_vtabptr_7cytoolz_9itertoolz__inner_join_index = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_index*)__Pyx_GetVtable(__pyx_ptype_7cytoolz_9itertoolz__inner_join_index->tp_dict); if (unlikely(!__pyx_vtabptr_7cytoolz_9itertoolz__inner_join_index)) __PYX_ERR(3, 221, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__inner_join_indices = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_inner_join_indices", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__inner_join_indices), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__inner_join_indices) __PYX_ERR(3, 224, __pyx_L1_error) __pyx_vtabptr_7cytoolz_9itertoolz__inner_join_indices = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__inner_join_indices*)__Pyx_GetVtable(__pyx_ptype_7cytoolz_9itertoolz__inner_join_indices->tp_dict); if (unlikely(!__pyx_vtabptr_7cytoolz_9itertoolz__inner_join_indices)) __PYX_ERR(3, 224, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__right_outer_join_key = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_right_outer_join_key", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_key), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__right_outer_join_key) __PYX_ERR(3, 227, __pyx_L1_error) __pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_key = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_key*)__Pyx_GetVtable(__pyx_ptype_7cytoolz_9itertoolz__right_outer_join_key->tp_dict); if (unlikely(!__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_key)) __PYX_ERR(3, 227, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__right_outer_join_index = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_right_outer_join_index", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_index), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__right_outer_join_index) __PYX_ERR(3, 230, __pyx_L1_error) __pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_index = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_index*)__Pyx_GetVtable(__pyx_ptype_7cytoolz_9itertoolz__right_outer_join_index->tp_dict); if (unlikely(!__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_index)) __PYX_ERR(3, 230, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__right_outer_join_indices = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_right_outer_join_indices", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__right_outer_join_indices), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__right_outer_join_indices) __PYX_ERR(3, 233, __pyx_L1_error) __pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_indices = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__right_outer_join_indices*)__Pyx_GetVtable(__pyx_ptype_7cytoolz_9itertoolz__right_outer_join_indices->tp_dict); if (unlikely(!__pyx_vtabptr_7cytoolz_9itertoolz__right_outer_join_indices)) __PYX_ERR(3, 233, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__left_outer_join_key = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_left_outer_join_key", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_key), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__left_outer_join_key) __PYX_ERR(3, 236, __pyx_L1_error) __pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_key = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_key*)__Pyx_GetVtable(__pyx_ptype_7cytoolz_9itertoolz__left_outer_join_key->tp_dict); if (unlikely(!__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_key)) __PYX_ERR(3, 236, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__left_outer_join_index = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_left_outer_join_index", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_index), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__left_outer_join_index) __PYX_ERR(3, 239, __pyx_L1_error) __pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_index = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_index*)__Pyx_GetVtable(__pyx_ptype_7cytoolz_9itertoolz__left_outer_join_index->tp_dict); if (unlikely(!__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_index)) __PYX_ERR(3, 239, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__left_outer_join_indices = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_left_outer_join_indices", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__left_outer_join_indices), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__left_outer_join_indices) __PYX_ERR(3, 242, __pyx_L1_error) __pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_indices = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__left_outer_join_indices*)__Pyx_GetVtable(__pyx_ptype_7cytoolz_9itertoolz__left_outer_join_indices->tp_dict); if (unlikely(!__pyx_vtabptr_7cytoolz_9itertoolz__left_outer_join_indices)) __PYX_ERR(3, 242, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__outer_join_key = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_outer_join_key", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__outer_join_key), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__outer_join_key) __PYX_ERR(3, 245, __pyx_L1_error) __pyx_vtabptr_7cytoolz_9itertoolz__outer_join_key = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_key*)__Pyx_GetVtable(__pyx_ptype_7cytoolz_9itertoolz__outer_join_key->tp_dict); if (unlikely(!__pyx_vtabptr_7cytoolz_9itertoolz__outer_join_key)) __PYX_ERR(3, 245, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__outer_join_index = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_outer_join_index", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__outer_join_index), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__outer_join_index) __PYX_ERR(3, 248, __pyx_L1_error) __pyx_vtabptr_7cytoolz_9itertoolz__outer_join_index = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_index*)__Pyx_GetVtable(__pyx_ptype_7cytoolz_9itertoolz__outer_join_index->tp_dict); if (unlikely(!__pyx_vtabptr_7cytoolz_9itertoolz__outer_join_index)) __PYX_ERR(3, 248, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__outer_join_indices = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_outer_join_indices", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__outer_join_indices), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__outer_join_indices) __PYX_ERR(3, 251, __pyx_L1_error) __pyx_vtabptr_7cytoolz_9itertoolz__outer_join_indices = (struct __pyx_vtabstruct_7cytoolz_9itertoolz__outer_join_indices*)__Pyx_GetVtable(__pyx_ptype_7cytoolz_9itertoolz__outer_join_indices->tp_dict); if (unlikely(!__pyx_vtabptr_7cytoolz_9itertoolz__outer_join_indices)) __PYX_ERR(3, 251, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__diff_key = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_diff_key", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__diff_key), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__diff_key) __PYX_ERR(3, 255, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz__diff_identity = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "_diff_identity", sizeof(struct __pyx_obj_7cytoolz_9itertoolz__diff_identity), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz__diff_identity) __PYX_ERR(3, 261, __pyx_L1_error) __pyx_ptype_7cytoolz_9itertoolz_random_sample = __Pyx_ImportType(__pyx_t_1, "cytoolz.itertoolz", "random_sample", sizeof(struct __pyx_obj_7cytoolz_9itertoolz_random_sample), __Pyx_ImportType_CheckSize_Warn); if (!__pyx_ptype_7cytoolz_9itertoolz_random_sample) __PYX_ERR(3, 278, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __pyx_t_1 = PyImport_ImportModule("cytoolz.itertoolz"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error) if (__Pyx_ImportFunction(__pyx_t_1, "frequencies", (void (**)(void))&__pyx_f_7cytoolz_9itertoolz_frequencies, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) if (__Pyx_ImportFunction(__pyx_t_1, "pluck", (void (**)(void))&__pyx_f_7cytoolz_9itertoolz_pluck, "PyObject *(PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7cytoolz_9itertoolz_pluck *__pyx_optional_args)") < 0) __PYX_ERR(1, 1, __pyx_L1_error) Py_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_RefNannyFinishContext(); return -1; } #if PY_MAJOR_VERSION < 3 #ifdef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC void #else #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #endif #else #ifdef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyObject * #else #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initrecipes(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initrecipes(void) #else __Pyx_PyMODINIT_FUNC PyInit_recipes(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_recipes(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { result = PyDict_SetItemString(moddict, to_name, value); } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_recipes(PyObject *__pyx_pyinit_module) #endif #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'recipes' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif #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("__Pyx_PyMODINIT_FUNC PyInit_recipes(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __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 CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("recipes", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) #endif __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __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_ERR(1, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_cytoolz__recipes) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "cytoolz.recipes")) { if (unlikely(PyDict_SetItemString(modules, "cytoolz.recipes", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error; /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error; /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error; (void)__Pyx_modinit_variable_import_code(); if (unlikely(__Pyx_modinit_function_import_code() != 0)) goto __pyx_L1_error; /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) #endif /* "cytoolz/recipes.pyx":4 * from cytoolz.itertoolz cimport frequencies, pluck * * from itertools import groupby # <<<<<<<<<<<<<< * from cytoolz.compatibility import map * */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_groupby); __Pyx_GIVEREF(__pyx_n_s_groupby); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_groupby); __pyx_t_2 = __Pyx_Import(__pyx_n_s_itertools, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 4, __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_groupby); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_groupby, __pyx_t_1) < 0) __PYX_ERR(1, 4, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "cytoolz/recipes.pyx":5 * * from itertools import groupby * from cytoolz.compatibility import map # <<<<<<<<<<<<<< * * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_n_s_map); __Pyx_GIVEREF(__pyx_n_s_map); PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_map); __pyx_t_1 = __Pyx_Import(__pyx_n_s_cytoolz_compatibility, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __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_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_map, __pyx_t_2) < 0) __PYX_ERR(1, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/recipes.pyx":8 * * * __all__ = ['countby', 'partitionby'] # <<<<<<<<<<<<<< * * */ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_countby); __Pyx_GIVEREF(__pyx_n_s_countby); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_countby); __Pyx_INCREF(__pyx_n_s_partitionby); __Pyx_GIVEREF(__pyx_n_s_partitionby); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_partitionby); if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(1, 8, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/recipes.pyx":11 * * * cpdef object countby(object key, object seq): # <<<<<<<<<<<<<< * """ * Count elements of a collection by a key function */ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_7recipes_1countby, 0, __pyx_n_s_countby, NULL, __pyx_n_s_cytoolz_recipes, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_countby, __pyx_t_1) < 0) __PYX_ERR(1, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): */ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_7recipes_11partitionby_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_partitionby___reduce_cython, NULL, __pyx_n_s_cytoolz_recipes, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "(tree fragment)":3 * def __reduce_cython__(self): * raise TypeError("no default __reduce__ due to non-trivial __cinit__") * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError("no default __reduce__ due to non-trivial __cinit__") */ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_7recipes_11partitionby_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_partitionby___setstate_cython, NULL, __pyx_n_s_cytoolz_recipes, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/recipes.pyx":1 * from cpython.sequence cimport PySequence_Tuple # <<<<<<<<<<<<<< * from cytoolz.itertoolz cimport frequencies, pluck * */ __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_countby_line_11, __pyx_kp_u_Count_elements_of_a_collection) < 0) __PYX_ERR(1, 1, __pyx_L1_error) if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init cytoolz.recipes", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_CLEAR(__pyx_m); } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init cytoolz.recipes"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS 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); } #endif /* GetBuiltinName */ 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; } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { return NULL; } if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif #endif /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { PyCFunctionObject *func = (PyCFunctionObject*)func_obj; PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyObject *self = PyCFunction_GET_SELF(func); int flags = PyCFunction_GET_FLAGS(func); assert(PyCFunction_Check(func)); assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); assert(nargs >= 0); assert(nargs == 0 || args != NULL); /* _PyCFunction_FastCallDict() must not be called with an exception set, because it may clear it (directly or indirectly) and so the caller loses its exception */ assert(!PyErr_Occurred()); if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); } else { return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); } } #endif /* PyObjectCall */ #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 (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* RaiseArgTupleInvalid */ 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); } /* RaiseDoubleKeywords */ 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 } /* ParseKeywords */ 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; } /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; 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); } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; } #endif /* IterNext */ static PyObject *__Pyx_PyIter_Next2Default(PyObject* defval) { PyObject* exc_type; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign exc_type = __Pyx_PyErr_Occurred(); if (unlikely(exc_type)) { if (!defval || unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) return NULL; __Pyx_PyErr_Clear(); Py_INCREF(defval); return defval; } if (defval) { Py_INCREF(defval); return defval; } __Pyx_PyErr_SetNone(PyExc_StopIteration); return NULL; } static void __Pyx_PyIter_Next_ErrorNoIterator(PyObject *iterator) { PyErr_Format(PyExc_TypeError, "%.200s object is not an iterator", Py_TYPE(iterator)->tp_name); } static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) { PyObject* next; iternextfunc iternext = Py_TYPE(iterator)->tp_iternext; if (likely(iternext)) { #if CYTHON_USE_TYPE_SLOTS next = iternext(iterator); if (likely(next)) return next; #if PY_VERSION_HEX >= 0x02070000 if (unlikely(iternext == &_PyObject_NextNotImplemented)) return NULL; #endif #else next = PyIter_Next(iterator); if (likely(next)) return next; #endif } else if (CYTHON_USE_TYPE_SLOTS || unlikely(!PyIter_Check(iterator))) { __Pyx_PyIter_Next_ErrorNoIterator(iterator); return NULL; } #if !CYTHON_USE_TYPE_SLOTS else { next = PyIter_Next(iterator); if (likely(next)) return next; } #endif return __Pyx_PyIter_Next2Default(defval); } /* RaiseTooManyValuesToUnpack */ 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); } /* RaiseNeedMoreValuesToUnpack */ 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"); } /* IterFinish */ static CYTHON_INLINE int __Pyx_IterFinish(void) { #if CYTHON_FAST_THREAD_STATE PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* exc_type = tstate->curexc_type; if (unlikely(exc_type)) { if (likely(__Pyx_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 } /* UnpackItemEndCheck */ 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; } /* RaiseException */ #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, CYTHON_UNUSED PyObject *cause) { __Pyx_PyThreadState_declare 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 (PyType_Check(type)) { #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; 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; } } __Pyx_PyThreadState_assign __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else 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) { int is_subclass = PyObject_IsSubclass(instance_class, type); if (!is_subclass) { instance_class = NULL; } else if (unlikely(is_subclass == -1)) { goto bad; } else { type = instance_class; } } } 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 (cause) { 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) { #if CYTHON_COMPILING_IN_PYPY PyObject *tmp_type, *tmp_value, *tmp_tb; PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); Py_INCREF(tb); PyErr_Restore(tmp_type, tmp_value, tb); Py_XDECREF(tmp_tb); #else PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } #endif } bad: Py_XDECREF(owned_instance); return; } #endif /* PyObject_GenericGetAttrNoDict */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { PyErr_Format(PyExc_AttributeError, #if PY_MAJOR_VERSION >= 3 "'%.50s' object has no attribute '%U'", tp->tp_name, attr_name); #else "'%.50s' object has no attribute '%.400s'", tp->tp_name, PyString_AS_STRING(attr_name)); #endif return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { PyObject *descr; PyTypeObject *tp = Py_TYPE(obj); if (unlikely(!PyString_Check(attr_name))) { return PyObject_GenericGetAttr(obj, attr_name); } assert(!tp->tp_dictoffset); descr = _PyType_Lookup(tp, attr_name); if (unlikely(!descr)) { return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); } Py_INCREF(descr); #if PY_MAJOR_VERSION < 3 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) #endif { descrgetfunc f = Py_TYPE(descr)->tp_descr_get; if (unlikely(f)) { PyObject *res = f(descr, obj, (PyObject *)tp); Py_DECREF(descr); return res; } } return descr; } #endif /* PyObject_GenericGetAttr */ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { return PyObject_GenericGetAttr(obj, attr_name); } return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); } #endif /* SetupReduce */ static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) { int ret; PyObject *name_attr; name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name); if (likely(name_attr)) { ret = PyObject_RichCompareBool(name_attr, name, Py_EQ); } else { ret = -1; } if (unlikely(ret < 0)) { PyErr_Clear(); ret = 0; } Py_XDECREF(name_attr); return ret; } static int __Pyx_setup_reduce(PyObject* type_obj) { int ret = 0; PyObject *object_reduce = NULL; PyObject *object_reduce_ex = NULL; PyObject *reduce = NULL; PyObject *reduce_ex = NULL; PyObject *reduce_cython = NULL; PyObject *setstate = NULL; PyObject *setstate_cython = NULL; #if CYTHON_USE_PYTYPE_LOOKUP if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD; #else if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD; #endif #if CYTHON_USE_PYTYPE_LOOKUP object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; #else object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD; #endif reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD; if (reduce_ex == object_reduce_ex) { #if CYTHON_USE_PYTYPE_LOOKUP object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; #else object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD; #endif reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD; if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) { reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD; ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD; setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate); if (!setstate) PyErr_Clear(); if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) { setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD; ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD; ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD; } PyType_Modified((PyTypeObject*)type_obj); } } goto GOOD; BAD: if (!PyErr_Occurred()) PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name); ret = -1; GOOD: #if !CYTHON_USE_PYTYPE_LOOKUP Py_XDECREF(object_reduce); Py_XDECREF(object_reduce_ex); #endif Py_XDECREF(reduce); Py_XDECREF(reduce_ex); Py_XDECREF(reduce_cython); Py_XDECREF(setstate); Py_XDECREF(setstate_cython); return ret; } /* TypeImport */ #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size) { PyObject *result = 0; char warning[200]; Py_ssize_t basicsize; #ifdef Py_LIMITED_API PyObject *py_basicsize; #endif result = PyObject_GetAttrString(module, class_name); 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 ((size_t)basicsize < size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) { PyErr_Format(PyExc_ValueError, "%.200s.%.200s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); goto bad; } else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility. " "Expected %zd from C header, got %zd from PyObject", module_name, class_name, size, basicsize); if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(result); return NULL; } #endif /* GetVTable */ 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 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; } /* Import */ 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_MAJOR_VERSION < 3 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_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } /* ImportFrom */ 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; } /* FetchCommonType */ 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; } /* CythonFunction */ #include 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, CYTHON_UNUSED void *context) { PyObject *tmp = op->func_doc; if (value == NULL) { value = Py_None; } Py_INCREF(value); op->func_doc = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 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); #else op->defaults_tuple = PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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} }; static PyMemberDef __pyx_CyFunction_members[] = { {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, 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[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif 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; __Pyx_CyFunction_weakreflist(op) = 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]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); PyObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(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 __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); } if (obj == Py_None) obj = NULL; return __Pyx_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 } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; Py_ssize_t size; switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 0)) return (*meth)(self, NULL); PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d 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 (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d 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; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; argc = PyTuple_GET_SIZE(args); new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, 0, 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_CyFunction_descr_get, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 0, #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, #endif }; static int __pyx_CyFunction_init(void) { __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); if (unlikely(__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 = PyObject_Malloc(size); if (unlikely(!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); } /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ 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 - start) / 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); } /* AddTraceback */ #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, 0, 0, 0, 0, __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, __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; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } 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_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 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); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 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(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #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_IntOrLong(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_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 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(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #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_IntOrLong(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_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = a->tp_base; if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; if (!res) { res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } return res; } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x02070000 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; } /* FunctionImport */ #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 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 /* InitStrings */ 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 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; if (PyObject_Hash(*t->p) == -1) 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 const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { 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 *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const 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)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #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 int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type %.200s). " "The ability to return an instance of a strict subclass of int " "is deprecated, and may be removed in a future version of Python.", Py_TYPE(result)->tp_name)) { Py_DECREF(result); return NULL; } return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", type_name, type_name, Py_TYPE(result)->tp_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } 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))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ cytoolz-0.10.1/cytoolz/recipes.pxd000066400000000000000000000001441355770264200171600ustar00rootroot00000000000000cpdef object countby(object key, object seq) cdef class partitionby: cdef object iter_groupby cytoolz-0.10.1/cytoolz/recipes.pyx000066400000000000000000000031461355770264200172120ustar00rootroot00000000000000from cpython.sequence cimport PySequence_Tuple from cytoolz.itertoolz cimport frequencies, pluck from itertools import groupby from cytoolz.compatibility import map __all__ = ['countby', 'partitionby'] cpdef object countby(object key, object seq): """ Count elements of a collection by a key function >>> countby(len, ['cat', 'mouse', 'dog']) {3: 2, 5: 1} >>> def iseven(x): return x % 2 == 0 >>> countby(iseven, [1, 2, 3]) # doctest:+SKIP {True: 1, False: 2} See Also: groupby """ if not callable(key): return frequencies(pluck(key, seq)) return frequencies(map(key, seq)) cdef class partitionby: """ partitionby(func, seq) Partition a sequence according to a function Partition `s` into a sequence of lists such that, when traversing `s`, every time the output of `func` changes a new list is started and that and subsequent items are collected into that list. >>> is_space = lambda c: c == " " >>> list(partitionby(is_space, "I have space")) [('I',), (' ',), ('h', 'a', 'v', 'e'), (' ',), ('s', 'p', 'a', 'c', 'e')] >>> is_large = lambda x: x > 10 >>> list(partitionby(is_large, [1, 2, 1, 99, 88, 33, 99, -1, 5])) [(1, 2, 1), (99, 88, 33, 99), (-1, 5)] See also: partition groupby itertools.groupby """ def __cinit__(self, object func, object seq): self.iter_groupby = groupby(seq, key=func) def __iter__(self): return self def __next__(self): cdef object key, val key, val = next(self.iter_groupby) return PySequence_Tuple(val) cytoolz-0.10.1/cytoolz/tests/000077500000000000000000000000001355770264200161545ustar00rootroot00000000000000cytoolz-0.10.1/cytoolz/tests/dev_skip_test.py000066400000000000000000000017531355770264200213770ustar00rootroot00000000000000""" Determine when dev tests should be skipped by regular users. Some tests are only intended to be tested during development right before performing a release. These do not test core functionality of `cytoolz` and may be skipped. These tests are only run if the following conditions are true: - toolz is installed - toolz is the correct version - cytoolz is a release version """ import cytoolz try: from nose.tools import nottest, istest except ImportError: istest = lambda func: setattr(func, '__test__', True) or func nottest = lambda func: setattr(func, '__test__', False) or func try: import toolz do_toolz_tests = True except ImportError: do_toolz_tests = False if do_toolz_tests: do_toolz_tests = cytoolz.__toolz_version__ == toolz.__version__ do_toolz_tests &= 'dev' not in cytoolz.__version__ # Decorator used to skip tests for developmental versions of CyToolz if do_toolz_tests: dev_skip_test = istest else: dev_skip_test = nottest cytoolz-0.10.1/cytoolz/tests/test_compatibility.py000066400000000000000000000010431355770264200224340ustar00rootroot00000000000000from cytoolz.compatibility import map, filter, iteritems, iterkeys, itervalues def test_map_filter_are_lazy(): def bad(x): raise Exception() map(bad, [1, 2, 3]) filter(bad, [1, 2, 3]) def test_dict_iteration(): d = {'a': 1, 'b': 2, 'c': 3} assert not isinstance(iteritems(d), list) assert not isinstance(iterkeys(d), list) assert not isinstance(itervalues(d), list) assert set(iteritems(d)) == set(d.items()) assert set(iterkeys(d)) == set(d.keys()) assert set(itervalues(d)) == set(d.values()) cytoolz-0.10.1/cytoolz/tests/test_curried.py000066400000000000000000000071671355770264200212350ustar00rootroot00000000000000import cytoolz import cytoolz.curried from cytoolz.curried import (take, first, second, sorted, merge_with, reduce, merge, operator as cop) from collections import defaultdict from importlib import import_module from operator import add def test_take(): assert list(take(2)([1, 2, 3])) == [1, 2] def test_first(): assert first is cytoolz.itertoolz.first def test_merge(): assert merge(factory=lambda: defaultdict(int))({1: 1}) == {1: 1} assert merge({1: 1}) == {1: 1} assert merge({1: 1}, factory=lambda: defaultdict(int)) == {1: 1} def test_merge_with(): assert merge_with(sum)({1: 1}, {1: 2}) == {1: 3} def test_merge_with_list(): assert merge_with(sum, [{'a': 1}, {'a': 2}]) == {'a': 3} def test_sorted(): assert sorted(key=second)([(1, 2), (2, 1)]) == [(2, 1), (1, 2)] def test_reduce(): assert reduce(add)((1, 2, 3)) == 6 def test_module_name(): assert cytoolz.curried.__name__ == 'cytoolz.curried' def test_curried_operator(): for k, v in vars(cop).items(): if not callable(v): continue if not isinstance(v, cytoolz.curry): try: # Make sure it is unary v(1) except TypeError: try: v('x') except TypeError: pass else: continue raise AssertionError( 'cytoolz.curried.operator.%s is not curried!' % k, ) # Make sure this isn't totally empty. assert len(set(vars(cop)) & {'add', 'sub', 'mul'}) == 3 def test_curried_namespace(): exceptions = import_module('cytoolz.curried.exceptions') namespace = {} def should_curry(func): if not callable(func) or isinstance(func, cytoolz.curry): return False nargs = cytoolz.functoolz.num_required_args(func) if nargs is None or nargs > 1: return True return nargs == 1 and cytoolz.functoolz.has_keywords(func) def curry_namespace(ns): return { name: cytoolz.curry(f) if should_curry(f) else f for name, f in ns.items() if '__' not in name } from_cytoolz = curry_namespace(vars(cytoolz)) from_exceptions = curry_namespace(vars(exceptions)) namespace.update(cytoolz.merge(from_cytoolz, from_exceptions)) namespace = cytoolz.valfilter(callable, namespace) curried_namespace = cytoolz.valfilter(callable, cytoolz.curried.__dict__) if namespace != curried_namespace: missing = set(namespace) - set(curried_namespace) if missing: raise AssertionError('There are missing functions in cytoolz.curried:\n %s' % ' \n'.join(sorted(missing))) extra = set(curried_namespace) - set(namespace) if extra: raise AssertionError('There are extra functions in cytoolz.curried:\n %s' % ' \n'.join(sorted(extra))) unequal = cytoolz.merge_with(list, namespace, curried_namespace) unequal = cytoolz.valfilter(lambda x: x[0] != x[1], unequal) messages = [] for name, (orig_func, auto_func) in sorted(unequal.items()): if name in from_exceptions: messages.append('%s should come from cytoolz.curried.exceptions' % name) elif should_curry(getattr(cytoolz, name)): messages.append('%s should be curried from cytoolz' % name) else: messages.append('%s should come from cytoolz and NOT be curried' % name) raise AssertionError('\n'.join(messages)) cytoolz-0.10.1/cytoolz/tests/test_curried_toolzlike.py000066400000000000000000000025671355770264200233300ustar00rootroot00000000000000import cytoolz import cytoolz.curried import types from dev_skip_test import dev_skip_test # Note that the tests in this file assume `toolz.curry` is a class, but we # may some day make `toolz.curry` a function and `toolz.Curry` a class. @dev_skip_test def test_toolzcurry_is_class(): import toolz assert isinstance(toolz.curry, type) is True assert isinstance(toolz.curry, types.FunctionType) is False @dev_skip_test def test_cytoolz_like_toolz(): import toolz import toolz.curried for key, val in vars(toolz.curried).items(): if isinstance(val, toolz.curry): if val.func is toolz.curry: # XXX: Python 3.4 work-around! continue assert hasattr(cytoolz.curried, key), ( 'cytoolz.curried.%s does not exist' % key) assert isinstance(getattr(cytoolz.curried, key), cytoolz.curry), ( 'cytoolz.curried.%s should be curried' % key) @dev_skip_test def test_toolz_like_cytoolz(): import toolz import toolz.curried for key, val in vars(cytoolz.curried).items(): if isinstance(val, cytoolz.curry): assert hasattr(toolz.curried, key), ( 'cytoolz.curried.%s should not exist' % key) assert isinstance(getattr(toolz.curried, key), toolz.curry), ( 'cytoolz.curried.%s should not be curried' % key) cytoolz-0.10.1/cytoolz/tests/test_dev_skip_test.py000066400000000000000000000005741355770264200224360ustar00rootroot00000000000000from dev_skip_test import istest, nottest, dev_skip_test d = {} @istest def test_passes(): d['istest'] = True assert True @nottest def test_fails(): d['nottest'] = True assert False def test_dev_skip_test(): assert dev_skip_test is istest or dev_skip_test is nottest assert d.get('istest', False) is True assert d.get('nottest', False) is False cytoolz-0.10.1/cytoolz/tests/test_dicttoolz.py000066400000000000000000000213611355770264200216030ustar00rootroot00000000000000from collections import defaultdict as _defaultdict import os from cytoolz.dicttoolz import (merge, merge_with, valmap, keymap, update_in, assoc, dissoc, keyfilter, valfilter, itemmap, itemfilter, assoc_in) from cytoolz.functoolz import identity from cytoolz.utils import raises from cytoolz.compatibility import PY3 def inc(x): return x + 1 def iseven(i): return i % 2 == 0 class TestDict(object): """Test typical usage: dict inputs, no factory keyword. Class attributes: D: callable that inputs a dict and creates or returns a MutableMapping kw: kwargs dict to specify "factory" keyword (if applicable) """ D = dict kw = {} def test_merge(self): D, kw = self.D, self.kw assert merge(D({1: 1, 2: 2}), D({3: 4}), **kw) == D({1: 1, 2: 2, 3: 4}) def test_merge_iterable_arg(self): D, kw = self.D, self.kw assert merge([D({1: 1, 2: 2}), D({3: 4})], **kw) == D({1: 1, 2: 2, 3: 4}) def test_merge_with(self): D, kw = self.D, self.kw dicts = D({1: 1, 2: 2}), D({1: 10, 2: 20}) assert merge_with(sum, *dicts, **kw) == D({1: 11, 2: 22}) assert merge_with(tuple, *dicts, **kw) == D({1: (1, 10), 2: (2, 20)}) dicts = D({1: 1, 2: 2, 3: 3}), D({1: 10, 2: 20}) assert merge_with(sum, *dicts, **kw) == D({1: 11, 2: 22, 3: 3}) assert merge_with(tuple, *dicts, **kw) == D({1: (1, 10), 2: (2, 20), 3: (3,)}) assert not merge_with(sum) def test_merge_with_iterable_arg(self): D, kw = self.D, self.kw dicts = D({1: 1, 2: 2}), D({1: 10, 2: 20}) assert merge_with(sum, *dicts, **kw) == D({1: 11, 2: 22}) assert merge_with(sum, dicts, **kw) == D({1: 11, 2: 22}) assert merge_with(sum, iter(dicts), **kw) == D({1: 11, 2: 22}) def test_valmap(self): D, kw = self.D, self.kw assert valmap(inc, D({1: 1, 2: 2}), **kw) == D({1: 2, 2: 3}) def test_keymap(self): D, kw = self.D, self.kw assert keymap(inc, D({1: 1, 2: 2}), **kw) == D({2: 1, 3: 2}) def test_itemmap(self): D, kw = self.D, self.kw assert itemmap(reversed, D({1: 2, 2: 4}), **kw) == D({2: 1, 4: 2}) def test_valfilter(self): D, kw = self.D, self.kw assert valfilter(iseven, D({1: 2, 2: 3}), **kw) == D({1: 2}) def test_keyfilter(self): D, kw = self.D, self.kw assert keyfilter(iseven, D({1: 2, 2: 3}), **kw) == D({2: 3}) def test_itemfilter(self): D, kw = self.D, self.kw assert itemfilter(lambda item: iseven(item[0]), D({1: 2, 2: 3}), **kw) == D({2: 3}) assert itemfilter(lambda item: iseven(item[1]), D({1: 2, 2: 3}), **kw) == D({1: 2}) def test_assoc(self): D, kw = self.D, self.kw assert assoc(D({}), "a", 1, **kw) == D({"a": 1}) assert assoc(D({"a": 1}), "a", 3, **kw) == D({"a": 3}) assert assoc(D({"a": 1}), "b", 3, **kw) == D({"a": 1, "b": 3}) # Verify immutability: d = D({'x': 1}) oldd = d assoc(d, 'x', 2, **kw) assert d is oldd def test_dissoc(self): D, kw = self.D, self.kw assert dissoc(D({"a": 1}), "a", **kw) == D({}) assert dissoc(D({"a": 1, "b": 2}), "a", **kw) == D({"b": 2}) assert dissoc(D({"a": 1, "b": 2}), "b", **kw) == D({"a": 1}) assert dissoc(D({"a": 1, "b": 2}), "a", "b", **kw) == D({}) assert dissoc(D({"a": 1}), "a", **kw) == dissoc(dissoc(D({"a": 1}), "a", **kw), "a", **kw) # Verify immutability: d = D({'x': 1}) oldd = d d2 = dissoc(d, 'x', **kw) assert d is oldd assert d2 is not oldd def test_assoc_in(self): D, kw = self.D, self.kw assert assoc_in(D({"a": 1}), ["a"], 2, **kw) == D({"a": 2}) assert (assoc_in(D({"a": D({"b": 1})}), ["a", "b"], 2, **kw) == D({"a": D({"b": 2})})) assert assoc_in(D({}), ["a", "b"], 1, **kw) == D({"a": D({"b": 1})}) # Verify immutability: d = D({'x': 1}) oldd = d d2 = assoc_in(d, ['x'], 2, **kw) assert d is oldd assert d2 is not oldd def test_update_in(self): D, kw = self.D, self.kw assert update_in(D({"a": 0}), ["a"], inc, **kw) == D({"a": 1}) assert update_in(D({"a": 0, "b": 1}), ["b"], str, **kw) == D({"a": 0, "b": "1"}) assert (update_in(D({"t": 1, "v": D({"a": 0})}), ["v", "a"], inc, **kw) == D({"t": 1, "v": D({"a": 1})})) # Handle one missing key. assert update_in(D({}), ["z"], str, None, **kw) == D({"z": "None"}) assert update_in(D({}), ["z"], inc, 0, **kw) == D({"z": 1}) assert update_in(D({}), ["z"], lambda x: x+"ar", default="b", **kw) == D({"z": "bar"}) # Same semantics as Clojure for multiple missing keys, ie. recursively # create nested empty dictionaries to the depth specified by the # keys with the innermost value set to f(default). assert update_in(D({}), [0, 1], inc, default=-1, **kw) == D({0: D({1: 0})}) assert update_in(D({}), [0, 1], str, default=100, **kw) == D({0: D({1: "100"})}) assert (update_in(D({"foo": "bar", 1: 50}), ["d", 1, 0], str, 20, **kw) == D({"foo": "bar", 1: 50, "d": D({1: D({0: "20"})})})) # Verify immutability: d = D({'x': 1}) oldd = d update_in(d, ['x'], inc, **kw) assert d is oldd def test_factory(self): D, kw = self.D, self.kw assert merge(defaultdict(int, D({1: 2})), D({2: 3})) == {1: 2, 2: 3} assert (merge(defaultdict(int, D({1: 2})), D({2: 3}), factory=lambda: defaultdict(int)) == defaultdict(int, D({1: 2, 2: 3}))) assert not (merge(defaultdict(int, D({1: 2})), D({2: 3}), factory=lambda: defaultdict(int)) == {1: 2, 2: 3}) assert raises(TypeError, lambda: merge(D({1: 2}), D({2: 3}), factoryy=dict)) class defaultdict(_defaultdict): def __eq__(self, other): return (super(defaultdict, self).__eq__(other) and isinstance(other, _defaultdict) and self.default_factory == other.default_factory) class TestDefaultDict(TestDict): """Test defaultdict as input and factory Class attributes: D: callable that inputs a dict and creates or returns a MutableMapping kw: kwargs dict to specify "factory" keyword (if applicable) """ @staticmethod def D(dict_): return defaultdict(int, dict_) kw = {'factory': lambda: defaultdict(int)} class CustomMapping(object): """Define methods of the MutableMapping protocol required by dicttoolz""" def __init__(self, *args, **kwargs): self._d = dict(*args, **kwargs) def __getitem__(self, key): return self._d[key] def __setitem__(self, key, val): self._d[key] = val def __delitem__(self, key): del self._d[key] def __iter__(self): return iter(self._d) def __len__(self): return len(self._d) def __contains__(self, key): return key in self._d def __eq__(self, other): return isinstance(other, CustomMapping) and self._d == other._d def __ne__(self, other): return not isinstance(other, CustomMapping) or self._d != other._d def keys(self): return self._d.keys() def values(self): return self._d.values() def items(self): return self._d.items() def update(self, *args, **kwargs): self._d.update(*args, **kwargs) # Should we require these to be defined for Python 2? if not PY3: def iterkeys(self): return self._d.iterkeys() def itervalues(self): return self._d.itervalues() def iteritems(self): return self._d.iteritems() # Unused methods that are part of the MutableMapping protocol #def get(self, key, *args): # return self._d.get(key, *args) #def pop(self, key, *args): # return self._d.pop(key, *args) #def popitem(self, key): # return self._d.popitem() #def clear(self): # self._d.clear() #def setdefault(self, key, *args): # return self._d.setdefault(self, key, *args) class TestCustomMapping(TestDict): """Test CustomMapping as input and factory Class attributes: D: callable that inputs a dict and creates or returns a MutableMapping kw: kwargs dict to specify "factory" keyword (if applicable) """ D = CustomMapping kw = {'factory': lambda: CustomMapping()} def test_environ(): # See: https://github.com/pycytoolz/cycytoolz/issues/127 assert keymap(identity, os.environ) == os.environ assert valmap(identity, os.environ) == os.environ assert itemmap(identity, os.environ) == os.environ cytoolz-0.10.1/cytoolz/tests/test_docstrings.py000066400000000000000000000057321355770264200217530ustar00rootroot00000000000000import difflib import cytoolz from cytoolz import curry, identity, keyfilter, valfilter, merge_with from cytoolz.utils import raises from dev_skip_test import dev_skip_test # `cytoolz` functions for which "# doctest: +SKIP" were added. # This may have been done because the error message may not exactly match. # The skipped tests should be added below with results and explanations. skipped_doctests = ['get_in'] @curry def isfrommod(modname, func): mod = getattr(func, '__module__', '') or '' return mod.startswith(modname) or 'toolz.functoolz.curry' in str(type(func)) def convertdoc(doc): """ Convert docstring from `toolz` to `cytoolz`.""" if hasattr(doc, '__doc__'): doc = doc.__doc__ doc = doc.replace('toolz', 'cytoolz') doc = doc.replace('dictcytoolz', 'dicttoolz') doc = doc.replace('funccytoolz', 'functoolz') doc = doc.replace('itercytoolz', 'itertoolz') doc = doc.replace('cytoolz.readthedocs', 'toolz.readthedocs') return doc @dev_skip_test def test_docstrings_uptodate(): import toolz differ = difflib.Differ() # only consider items created in both `toolz` and `cytoolz` toolz_dict = valfilter(isfrommod('toolz'), toolz.__dict__) cytoolz_dict = valfilter(isfrommod('cytoolz'), cytoolz.__dict__) # only test functions that have docstrings defined in `toolz` toolz_dict = valfilter(lambda x: getattr(x, '__doc__', ''), toolz_dict) # full API coverage should be tested elsewhere toolz_dict = keyfilter(lambda x: x in cytoolz_dict, toolz_dict) cytoolz_dict = keyfilter(lambda x: x in toolz_dict, cytoolz_dict) d = merge_with(identity, toolz_dict, cytoolz_dict) for key, (toolz_func, cytoolz_func) in d.items(): # only check if the new doctstring *contains* the expected docstring toolz_doc = convertdoc(toolz_func) cytoolz_doc = cytoolz_func.__doc__ if toolz_doc not in cytoolz_doc: diff = list(differ.compare(toolz_doc.splitlines(), cytoolz_doc.splitlines())) fulldiff = list(diff) # remove additional lines at the beginning while diff and diff[0].startswith('+'): diff.pop(0) # remove additional lines at the end while diff and diff[-1].startswith('+'): diff.pop() def checkbad(line): return (line.startswith('+') and not ('# doctest: +SKIP' in line and key in skipped_doctests)) if any(map(checkbad, diff)): assert False, 'Error: cytoolz.%s has a bad docstring:\n%s\n' % ( key, '\n'.join(fulldiff)) def test_get_in_doctest(): # Original doctest: # >>> get_in(['y'], {}, no_default=True) # Traceback (most recent call last): # ... # KeyError: 'y' # cytoolz result: # KeyError: raises(KeyError, lambda: cytoolz.get_in(['y'], {}, no_default=True)) cytoolz-0.10.1/cytoolz/tests/test_doctests.py000066400000000000000000000006631355770264200214220ustar00rootroot00000000000000from cytoolz.utils_test import module_doctest import cytoolz import cytoolz.dicttoolz import cytoolz.functoolz import cytoolz.itertoolz import cytoolz.recipes def test_doctest(): assert module_doctest(cytoolz) is True assert module_doctest(cytoolz.dicttoolz) is True assert module_doctest(cytoolz.functoolz) is True assert module_doctest(cytoolz.itertoolz) is True assert module_doctest(cytoolz.recipes) is True cytoolz-0.10.1/cytoolz/tests/test_embedded_sigs.py000066400000000000000000000066471355770264200223600ustar00rootroot00000000000000import inspect import cytoolz from types import BuiltinFunctionType from cytoolz import curry, identity, keyfilter, valfilter, merge_with from dev_skip_test import dev_skip_test @curry def isfrommod(modname, func): mod = getattr(func, '__module__', '') or '' return mod.startswith(modname) or 'toolz.functoolz.curry' in str(type(func)) @dev_skip_test def test_class_sigs(): """ Test that all ``cdef class`` extension types in ``cytoolz`` have correctly embedded the function signature as done in ``toolz``. """ import toolz # only consider items created in both `toolz` and `cytoolz` toolz_dict = valfilter(isfrommod('toolz'), toolz.__dict__) cytoolz_dict = valfilter(isfrommod('cytoolz'), cytoolz.__dict__) # only test `cdef class` extensions from `cytoolz` cytoolz_dict = valfilter(lambda x: not isinstance(x, BuiltinFunctionType), cytoolz_dict) # full API coverage should be tested elsewhere toolz_dict = keyfilter(lambda x: x in cytoolz_dict, toolz_dict) cytoolz_dict = keyfilter(lambda x: x in toolz_dict, cytoolz_dict) d = merge_with(identity, toolz_dict, cytoolz_dict) for key, (toolz_func, cytoolz_func) in d.items(): if key in ['excepts', 'juxt', 'memoize', 'flip']: continue try: # function toolz_spec = inspect.getargspec(toolz_func) except TypeError: try: # curried or partial object toolz_spec = inspect.getargspec(toolz_func.func) except (TypeError, AttributeError): # class toolz_spec = inspect.getargspec(toolz_func.__init__) # For Cython < 0.25 toolz_sig = toolz_func.__name__ + inspect.formatargspec(*toolz_spec) doc = cytoolz_func.__doc__ # For Cython >= 0.25 toolz_sig_alt = toolz_func.__name__ + inspect.formatargspec( *toolz_spec, **{'formatvalue': lambda x: '=' + getattr(x, '__name__', repr(x))} ) doc_alt = doc.replace('Py_ssize_t ', '') if not (toolz_sig in doc or toolz_sig_alt in doc_alt): message = ('cytoolz.%s does not have correct function signature.' '\n\nExpected: %s' '\n\nDocstring in cytoolz is:\n%s' % (key, toolz_sig, cytoolz_func.__doc__)) assert False, message skip_sigs = ['identity'] aliases = {'comp': 'compose'} @dev_skip_test def test_sig_at_beginning(): """ Test that the function signature is at the beginning of the docstring and is followed by exactly one blank line. """ cytoolz_dict = valfilter(isfrommod('cytoolz'), cytoolz.__dict__) cytoolz_dict = keyfilter(lambda x: x not in skip_sigs, cytoolz_dict) for key, val in cytoolz_dict.items(): doclines = val.__doc__.splitlines() assert len(doclines) > 2, ( 'cytoolz.%s docstring too short:\n\n%s' % (key, val.__doc__)) sig = '%s(' % aliases.get(key, key) assert sig in doclines[0], ( 'cytoolz.%s docstring missing signature at beginning:\n\n%s' % (key, val.__doc__)) assert not doclines[1], ( 'cytoolz.%s docstring missing blank line after signature:\n\n%s' % (key, val.__doc__)) assert doclines[2], ( 'cytoolz.%s docstring too many blank lines after signature:\n\n%s' % (key, val.__doc__)) cytoolz-0.10.1/cytoolz/tests/test_functoolz.py000066400000000000000000000475771355770264200216340ustar00rootroot00000000000000import inspect import cytoolz from cytoolz.functoolz import (thread_first, thread_last, memoize, curry, compose, compose_left, pipe, complement, do, juxt, flip, excepts, apply) from cytoolz.compatibility import PY3 from operator import add, mul, itemgetter from cytoolz.utils import raises from functools import partial def iseven(x): return x % 2 == 0 def isodd(x): return x % 2 == 1 def inc(x): return x + 1 def double(x): return 2 * x class AlwaysEquals(object): """useful to test correct __eq__ implementation of other objects""" def __eq__(self, other): return True def __ne__(self, other): return False class NeverEquals(object): """useful to test correct __eq__ implementation of other objects""" def __eq__(self, other): return False def __ne__(self, other): return True def test_apply(): assert apply(double, 5) == 10 assert tuple(map(apply, [double, inc, double], [10, 500, 8000])) == (20, 501, 16000) assert raises(TypeError, apply) def test_thread_first(): assert thread_first(2) == 2 assert thread_first(2, inc) == 3 assert thread_first(2, inc, inc) == 4 assert thread_first(2, double, inc) == 5 assert thread_first(2, (add, 5), double) == 14 def test_thread_last(): assert list(thread_last([1, 2, 3], (map, inc), (filter, iseven))) == [2, 4] assert list(thread_last([1, 2, 3], (map, inc), (filter, isodd))) == [3] assert thread_last(2, (add, 5), double) == 14 def test_memoize(): fn_calls = [0] # Storage for side effects def f(x, y): """ A docstring """ fn_calls[0] += 1 return x + y mf = memoize(f) assert mf(2, 3) is mf(2, 3) assert fn_calls == [1] # function was only called once assert mf.__doc__ == f.__doc__ assert raises(TypeError, lambda: mf(1, {})) def test_memoize_kwargs(): fn_calls = [0] # Storage for side effects def f(x, y=0): return x + y mf = memoize(f) assert mf(1) == f(1) assert mf(1, 2) == f(1, 2) assert mf(1, y=2) == f(1, y=2) assert mf(1, y=3) == f(1, y=3) def test_memoize_curried(): @curry def f(x, y=0): return x + y f2 = f(y=1) fm2 = memoize(f2) assert fm2(3) == f2(3) assert fm2(3) == f2(3) def test_memoize_partial(): def f(x, y=0): return x + y f2 = partial(f, y=1) fm2 = memoize(f2) assert fm2(3) == f2(3) assert fm2(3) == f2(3) def test_memoize_key_signature(): # Single argument should not be tupled as a key. No keywords. mf = memoize(lambda x: False, cache={1: True}) assert mf(1) is True assert mf(2) is False # Single argument must be tupled if signature has varargs. No keywords. mf = memoize(lambda x, *args: False, cache={(1,): True, (1, 2): 2}) assert mf(1) is True assert mf(2) is False assert mf(1, 1) is False assert mf(1, 2) == 2 assert mf((1, 2)) is False # More than one argument is always tupled. No keywords. mf = memoize(lambda x, y: False, cache={(1, 2): True}) assert mf(1, 2) is True assert mf(1, 3) is False assert raises(TypeError, lambda: mf((1, 2))) # Nullary function (no inputs) uses empty tuple as the key mf = memoize(lambda: False, cache={(): True}) assert mf() is True # Single argument must be tupled if there are keyword arguments, because # keyword arguments may be passed as unnamed args. mf = memoize(lambda x, y=0: False, cache={((1,), frozenset((('y', 2),))): 2, ((1, 2), None): 3}) assert mf(1, y=2) == 2 assert mf(1, 2) == 3 assert mf(2, y=2) is False assert mf(2, 2) is False assert mf(1) is False assert mf((1, 2)) is False # Keyword-only signatures must still have an "args" tuple. mf = memoize(lambda x=0: False, cache={(None, frozenset((('x', 1),))): 1, ((1,), None): 2}) assert mf() is False assert mf(x=1) == 1 assert mf(1) == 2 def test_memoize_curry_cache(): @memoize(cache={1: True}) def f(x): return False assert f(1) is True assert f(2) is False def test_memoize_key(): @memoize(key=lambda args, kwargs: args[0]) def f(x, y, *args, **kwargs): return x + y assert f(1, 2) == 3 assert f(1, 3) == 3 def test_memoize_wrapped(): def foo(): """ Docstring """ pass memoized_foo = memoize(foo) assert memoized_foo.__wrapped__ is foo def test_curry_simple(): cmul = curry(mul) double = cmul(2) assert callable(double) assert double(10) == 20 assert repr(cmul) == repr(mul) cmap = curry(map) assert list(cmap(inc)([1, 2, 3])) == [2, 3, 4] assert raises(TypeError, lambda: curry()) assert raises(TypeError, lambda: curry({1: 2})) def test_curry_kwargs(): def f(a, b, c=10): return (a + b) * c f = curry(f) assert f(1, 2, 3) == 9 assert f(1)(2, 3) == 9 assert f(1, 2) == 30 assert f(1, c=3)(2) == 9 assert f(c=3)(1, 2) == 9 def g(a=1, b=10, c=0): return a + b + c cg = curry(g, b=2) assert cg() == 3 assert cg(b=3) == 4 assert cg(a=0) == 2 assert cg(a=0, b=1) == 1 assert cg(0) == 2 # pass "a" as arg, not kwarg assert raises(TypeError, lambda: cg(1, 2)) # pass "b" as arg AND kwarg def h(x, func=int): return func(x) # __init__ must not pick func as positional arg assert curry(h)(0.0) == 0 assert curry(h)(func=str)(0.0) == '0.0' assert curry(h, func=str)(0.0) == '0.0' def test_curry_passes_errors(): @curry def f(a, b): if not isinstance(a, int): raise TypeError() return a + b assert f(1, 2) == 3 assert raises(TypeError, lambda: f('1', 2)) assert raises(TypeError, lambda: f('1')(2)) assert raises(TypeError, lambda: f(1, 2, 3)) def test_curry_docstring(): def f(x, y): """ A docstring """ return x g = curry(f) assert g.__doc__ == f.__doc__ assert str(g) == str(f) assert f(1, 2) == g(1, 2) def test_curry_is_like_partial(): def foo(a, b, c=1): return a + b + c p, c = partial(foo, 1, c=2), curry(foo)(1, c=2) assert p.keywords == c.keywords assert p.args == c.args assert p(3) == c(3) p, c = partial(foo, 1), curry(foo)(1) assert p.keywords == c.keywords assert p.args == c.args assert p(3) == c(3) assert p(3, c=2) == c(3, c=2) p, c = partial(foo, c=1), curry(foo)(c=1) assert p.keywords == c.keywords assert p.args == c.args assert p(1, 2) == c(1, 2) def test_curry_is_idempotent(): def foo(a, b, c=1): return a + b + c f = curry(foo, 1, c=2) g = curry(f) assert isinstance(f, curry) assert isinstance(g, curry) assert not isinstance(g.func, curry) assert not hasattr(g.func, 'func') assert f.func == g.func assert f.args == g.args assert f.keywords == g.keywords def test_curry_attributes_readonly(): def foo(a, b, c=1): return a + b + c f = curry(foo, 1, c=2) assert raises(AttributeError, lambda: setattr(f, 'args', (2,))) assert raises(AttributeError, lambda: setattr(f, 'keywords', {'c': 3})) assert raises(AttributeError, lambda: setattr(f, 'func', f)) assert raises(AttributeError, lambda: delattr(f, 'args')) assert raises(AttributeError, lambda: delattr(f, 'keywords')) assert raises(AttributeError, lambda: delattr(f, 'func')) def test_curry_attributes_writable(): def foo(a, b, c=1): return a + b + c foo.__qualname__ = 'this.is.foo' f = curry(foo, 1, c=2) assert f.__qualname__ == 'this.is.foo' f.__name__ = 'newname' f.__doc__ = 'newdoc' f.__module__ = 'newmodule' f.__qualname__ = 'newqualname' assert f.__name__ == 'newname' assert f.__doc__ == 'newdoc' assert f.__module__ == 'newmodule' assert f.__qualname__ == 'newqualname' if hasattr(f, 'func_name'): assert f.__name__ == f.func_name def test_curry_module(): from cytoolz.curried.exceptions import merge assert merge.__module__ == 'cytoolz.curried.exceptions' def test_curry_comparable(): def foo(a, b, c=1): return a + b + c f1 = curry(foo, 1, c=2) f2 = curry(foo, 1, c=2) g1 = curry(foo, 1, c=3) h1 = curry(foo, c=2) h2 = h1(c=2) h3 = h1() assert f1 == f2 assert not (f1 != f2) assert f1 != g1 assert not (f1 == g1) assert f1 != h1 assert h1 == h2 assert h1 == h3 # test function comparison works def bar(a, b, c=1): return a + b + c b1 = curry(bar, 1, c=2) assert b1 != f1 assert {f1, f2, g1, h1, h2, h3, b1, b1()} == {f1, g1, h1, b1} # test unhashable input unhash1 = curry(foo, []) assert raises(TypeError, lambda: hash(unhash1)) unhash2 = curry(foo, c=[]) assert raises(TypeError, lambda: hash(unhash2)) def test_curry_doesnot_transmogrify(): # Early versions of `curry` transmogrified to `partial` objects if # only one positional argument remained even if keyword arguments # were present. Now, `curry` should always remain `curry`. def f(x, y=0): return x + y cf = curry(f) assert cf(y=1)(y=2)(y=3)(1) == f(1, 3) def test_curry_on_classmethods(): class A(object): BASE = 10 def __init__(self, base): self.BASE = base @curry def addmethod(self, x, y): return self.BASE + x + y @classmethod @curry def addclass(cls, x, y): return cls.BASE + x + y @staticmethod @curry def addstatic(x, y): return x + y a = A(100) assert a.addmethod(3, 4) == 107 assert a.addmethod(3)(4) == 107 assert A.addmethod(a, 3, 4) == 107 assert A.addmethod(a)(3)(4) == 107 assert a.addclass(3, 4) == 17 assert a.addclass(3)(4) == 17 assert A.addclass(3, 4) == 17 assert A.addclass(3)(4) == 17 assert a.addstatic(3, 4) == 7 assert a.addstatic(3)(4) == 7 assert A.addstatic(3, 4) == 7 assert A.addstatic(3)(4) == 7 # we want this to be of type curry assert isinstance(a.addmethod, curry) assert isinstance(A.addmethod, curry) def test_memoize_on_classmethods(): class A(object): BASE = 10 HASH = 10 def __init__(self, base): self.BASE = base @memoize def addmethod(self, x, y): return self.BASE + x + y @classmethod @memoize def addclass(cls, x, y): return cls.BASE + x + y @staticmethod @memoize def addstatic(x, y): return x + y def __hash__(self): return self.HASH a = A(100) assert a.addmethod(3, 4) == 107 assert A.addmethod(a, 3, 4) == 107 a.BASE = 200 assert a.addmethod(3, 4) == 107 a.HASH = 200 assert a.addmethod(3, 4) == 207 assert a.addclass(3, 4) == 17 assert A.addclass(3, 4) == 17 A.BASE = 20 assert A.addclass(3, 4) == 17 A.HASH = 20 # hashing of class is handled by metaclass assert A.addclass(3, 4) == 17 # hence, != 27 assert a.addstatic(3, 4) == 7 assert A.addstatic(3, 4) == 7 def test_curry_call(): @curry def add(x, y): return x + y assert raises(TypeError, lambda: add.call(1)) assert add(1)(2) == add.call(1, 2) assert add(1)(2) == add(1).call(2) def test_curry_bind(): @curry def add(x=1, y=2): return x + y assert add() == add(1, 2) assert add.bind(10)(20) == add(10, 20) assert add.bind(10).bind(20)() == add(10, 20) assert add.bind(x=10)(y=20) == add(10, 20) assert add.bind(x=10).bind(y=20)() == add(10, 20) def test_curry_unknown_args(): def add3(x, y, z): return x + y + z @curry def f(*args): return add3(*args) assert f()(1)(2)(3) == 6 assert f(1)(2)(3) == 6 assert f(1, 2)(3) == 6 assert f(1, 2, 3) == 6 assert f(1, 2)(3, 4) == f(1, 2, 3, 4) def test_curry_bad_types(): assert raises(TypeError, lambda: curry(1)) def test_curry_subclassable(): class mycurry(curry): pass add = mycurry(lambda x, y: x+y) assert isinstance(add, curry) assert isinstance(add, mycurry) assert isinstance(add(1), mycurry) assert isinstance(add()(1), mycurry) assert add(1)(2) == 3 # Should we make `_should_curry` public? """ class curry2(curry): def _should_curry(self, args, kwargs, exc=None): return len(self.args) + len(args) < 2 add = curry2(lambda x, y: x+y) assert isinstance(add(1), curry2) assert add(1)(2) == 3 assert isinstance(add(1)(x=2), curry2) assert raises(TypeError, lambda: add(1)(x=2)(3)) """ def generate_compose_test_cases(): """ Generate test cases for parametrized tests of the compose function. """ def add_then_multiply(a, b, c=10): return (a + b) * c return ( ( (), # arguments to compose() (0,), {}, # positional and keyword args to the Composed object 0 # expected result ), ( (inc,), (0,), {}, 1 ), ( (double, inc), (0,), {}, 2 ), ( (str, iseven, inc, double), (3,), {}, "False" ), ( (str, add), (1, 2), {}, '3' ), ( (str, inc, add_then_multiply), (1, 2), {"c": 3}, '10' ), ) def test_compose(): for (compose_args, args, kw, expected) in generate_compose_test_cases(): assert compose(*compose_args)(*args, **kw) == expected def test_compose_metadata(): # Define two functions with different names def f(a): return a def g(a): return a composed = compose(f, g) assert composed.__name__ == 'f_of_g' assert composed.__doc__ == 'lambda *args, **kwargs: f(g(*args, **kwargs))' # Create an object with no __name__. h = object() composed = compose(f, h) assert composed.__name__ == 'Compose' assert composed.__doc__ == 'A composition of functions' assert repr(composed) == 'Compose({!r}, {!r})'.format(f, h) assert composed == compose(f, h) assert composed == AlwaysEquals() assert not composed == compose(h, f) assert not composed == object() assert not composed == NeverEquals() assert composed != compose(h, f) assert composed != NeverEquals() assert composed != object() assert not composed != compose(f, h) assert not composed != AlwaysEquals() assert hash(composed) == hash(compose(f, h)) assert hash(composed) != hash(compose(h, f)) bindable = compose(str, lambda x: x*2, lambda x, y=0: int(x) + y) class MyClass: def __int__(self): return 8 my_method = bindable my_static_method = staticmethod(bindable) assert MyClass.my_method(3) == '6' assert MyClass.my_method(3, y=2) == '10' assert MyClass.my_static_method(2) == '4' assert MyClass().my_method() == '16' assert MyClass().my_method(y=3) == '22' assert MyClass().my_static_method(0) == '0' assert MyClass().my_static_method(0, 1) == '2' assert compose(f, h).__wrapped__ is h if hasattr(cytoolz, 'sandbox'): # only test this with Python version (i.e., not Cython) assert compose(f, h).__class__.__wrapped__ is None # __signature__ is python3 only if PY3: def myfunc(a, b, c, *d, **e): return 4 def otherfunc(f): return 'result: {}'.format(f) # set annotations compatibly with python2 syntax myfunc.__annotations__ = { 'a': int, 'b': str, 'c': float, 'd': int, 'e': bool, 'return': int, } otherfunc.__annotations__ = {'f': int, 'return': str} composed = compose(otherfunc, myfunc) sig = inspect.signature(composed) assert sig.parameters == inspect.signature(myfunc).parameters assert sig.return_annotation == str class MyClass: method = composed assert len(inspect.signature(MyClass().method).parameters) == 4 def generate_compose_left_test_cases(): """ Generate test cases for parametrized tests of the compose function. These are based on, and equivalent to, those produced by enerate_compose_test_cases(). """ return tuple( (tuple(reversed(compose_args)), args, kwargs, expected) for (compose_args, args, kwargs, expected) in generate_compose_test_cases() ) def test_compose_left(): for (compose_left_args, args, kw, expected) in generate_compose_left_test_cases(): assert compose_left(*compose_left_args)(*args, **kw) == expected def test_pipe(): assert pipe(1, inc) == 2 assert pipe(1, inc, inc) == 3 assert pipe(1, double, inc, iseven) is False def test_complement(): # No args: assert complement(lambda: False)() assert not complement(lambda: True)() # Single arity: assert complement(iseven)(1) assert not complement(iseven)(2) assert complement(complement(iseven))(2) assert not complement(complement(isodd))(2) # Multiple arities: both_even = lambda a, b: iseven(a) and iseven(b) assert complement(both_even)(1, 2) assert not complement(both_even)(2, 2) # Generic truthiness: assert complement(lambda: "")() assert complement(lambda: 0)() assert complement(lambda: None)() assert complement(lambda: [])() assert not complement(lambda: "x")() assert not complement(lambda: 1)() assert not complement(lambda: [1])() def test_do(): inc = lambda x: x + 1 assert do(inc, 1) == 1 log = [] assert do(log.append, 1) == 1 assert log == [1] def test_juxt_generator_input(): data = list(range(10)) juxtfunc = juxt(itemgetter(2*i) for i in range(5)) assert juxtfunc(data) == (0, 2, 4, 6, 8) assert juxtfunc(data) == (0, 2, 4, 6, 8) def test_flip(): def f(a, b): return a, b assert flip(f, 'a', 'b') == ('b', 'a') def test_excepts(): # These are descriptors, make sure this works correctly. assert excepts.__name__ == 'excepts' assert ( 'A wrapper around a function to catch exceptions and\n' ' dispatch to a handler.\n' ) in excepts.__doc__ def idx(a): """idx docstring """ return [1, 2].index(a) def handler(e): """handler docstring """ assert isinstance(e, ValueError) return -1 excepting = excepts(ValueError, idx, handler) assert excepting(1) == 0 assert excepting(2) == 1 assert excepting(3) == -1 assert excepting.__name__ == 'idx_excepting_ValueError' assert 'idx docstring' in excepting.__doc__ assert 'ValueError' in excepting.__doc__ assert 'handler docstring' in excepting.__doc__ def getzero(a): """getzero docstring """ return a[0] excepting = excepts((IndexError, KeyError), getzero) assert excepting([]) is None assert excepting([1]) == 1 assert excepting({}) is None assert excepting({0: 1}) == 1 assert excepting.__name__ == 'getzero_excepting_IndexError_or_KeyError' assert 'getzero docstring' in excepting.__doc__ assert 'return_none' in excepting.__doc__ assert 'Returns None' in excepting.__doc__ def raise_(a): """A function that raises an instance of the exception type given. """ raise a() excepting = excepts((ValueError, KeyError), raise_) assert excepting(ValueError) is None assert excepting(KeyError) is None assert raises(TypeError, lambda: excepting(TypeError)) assert raises(NotImplementedError, lambda: excepting(NotImplementedError)) excepting = excepts(object(), object(), object()) assert excepting.__name__ == 'excepting' assert excepting.__doc__ == excepts.__doc__ cytoolz-0.10.1/cytoolz/tests/test_inspect_args.py000066400000000000000000000375741355770264200222660ustar00rootroot00000000000000import functools import inspect import itertools import operator import cytoolz from cytoolz.functoolz import (curry, is_valid_args, is_partial_args, is_arity, num_required_args, has_varargs, has_keywords) from cytoolz._signatures import builtins import cytoolz._signatures as _sigs from cytoolz.compatibility import PY3 from cytoolz.utils import raises def make_func(param_string, raise_if_called=True): if not param_string.startswith('('): param_string = '(%s)' % param_string if raise_if_called: body = 'raise ValueError("function should not be called")' else: body = 'return True' d = {} exec('def func%s:\n %s' % (param_string, body), globals(), d) return d['func'] def test_make_func(): f = make_func('') assert raises(ValueError, lambda: f()) assert raises(TypeError, lambda: f(1)) f = make_func('', raise_if_called=False) assert f() assert raises(TypeError, lambda: f(1)) f = make_func('x, y=1', raise_if_called=False) assert f(1) assert f(x=1) assert f(1, 2) assert f(x=1, y=2) assert raises(TypeError, lambda: f(1, 2, 3)) f = make_func('(x, y=1)', raise_if_called=False) assert f(1) assert f(x=1) assert f(1, 2) assert f(x=1, y=2) assert raises(TypeError, lambda: f(1, 2, 3)) def test_is_valid(check_valid=is_valid_args, incomplete=False): orig_check_valid = check_valid check_valid = lambda func, *args, **kwargs: orig_check_valid(func, args, kwargs) f = make_func('') assert check_valid(f) assert check_valid(f, 1) is False assert check_valid(f, x=1) is False f = make_func('x') assert check_valid(f) is incomplete assert check_valid(f, 1) assert check_valid(f, x=1) assert check_valid(f, 1, x=2) is False assert check_valid(f, 1, y=2) is False assert check_valid(f, 1, 2) is False assert check_valid(f, x=1, y=2) is False f = make_func('x=1') assert check_valid(f) assert check_valid(f, 1) assert check_valid(f, x=1) assert check_valid(f, 1, x=2) is False assert check_valid(f, 1, y=2) is False assert check_valid(f, 1, 2) is False assert check_valid(f, x=1, y=2) is False f = make_func('*args') assert check_valid(f) assert check_valid(f, 1) assert check_valid(f, 1, 2) assert check_valid(f, x=1) is False f = make_func('**kwargs') assert check_valid(f) assert check_valid(f, x=1) assert check_valid(f, x=1, y=2) assert check_valid(f, 1) is False f = make_func('x, *args') assert check_valid(f) is incomplete assert check_valid(f, 1) assert check_valid(f, 1, 2) assert check_valid(f, x=1) assert check_valid(f, 1, x=1) is False assert check_valid(f, 1, y=1) is False f = make_func('x, y=1, **kwargs') assert check_valid(f) is incomplete assert check_valid(f, 1) assert check_valid(f, x=1) assert check_valid(f, 1, 2) assert check_valid(f, x=1, y=2, z=3) assert check_valid(f, 1, 2, y=3) is False f = make_func('a, b, c=3, d=4') assert check_valid(f) is incomplete assert check_valid(f, 1) is incomplete assert check_valid(f, 1, 2) assert check_valid(f, 1, c=3) is incomplete assert check_valid(f, 1, e=3) is False assert check_valid(f, 1, 2, e=3) is False assert check_valid(f, 1, 2, b=3) is False assert check_valid(1) is False def test_is_valid_py3(check_valid=is_valid_args, incomplete=False): if not PY3: return orig_check_valid = check_valid check_valid = lambda func, *args, **kwargs: orig_check_valid(func, args, kwargs) f = make_func('x, *, y=1') assert check_valid(f) is incomplete assert check_valid(f, 1) assert check_valid(f, x=1) assert check_valid(f, 1, y=2) assert check_valid(f, 1, 2) is False assert check_valid(f, 1, z=2) is False f = make_func('x, *args, y=1') assert check_valid(f) is incomplete assert check_valid(f, 1) assert check_valid(f, x=1) assert check_valid(f, 1, y=2) assert check_valid(f, 1, 2, y=2) assert check_valid(f, 1, 2) assert check_valid(f, 1, z=2) is False f = make_func('*, y=1') assert check_valid(f) assert check_valid(f, 1) is False assert check_valid(f, y=1) assert check_valid(f, z=1) is False f = make_func('x, *, y') assert check_valid(f) is incomplete assert check_valid(f, 1) is incomplete assert check_valid(f, x=1) is incomplete assert check_valid(f, 1, y=2) assert check_valid(f, x=1, y=2) assert check_valid(f, 1, 2) is False assert check_valid(f, 1, z=2) is False assert check_valid(f, 1, y=1, z=2) is False f = make_func('x=1, *, y, z=3') assert check_valid(f) is incomplete assert check_valid(f, 1, z=3) is incomplete assert check_valid(f, y=2) assert check_valid(f, 1, y=2) assert check_valid(f, x=1, y=2) assert check_valid(f, x=1, y=2, z=3) assert check_valid(f, 1, x=1, y=2) is False assert check_valid(f, 1, 3, y=2) is False f = make_func('w, x=2, *args, y, z=4') assert check_valid(f) is incomplete assert check_valid(f, 1) is incomplete assert check_valid(f, 1, y=3) f = make_func('a, b, c=3, d=4, *args, e=5, f=6, g, h') assert check_valid(f) is incomplete assert check_valid(f, 1) is incomplete assert check_valid(f, 1, 2) is incomplete assert check_valid(f, 1, 2, g=7) is incomplete assert check_valid(f, 1, 2, g=7, h=8) assert check_valid(f, 1, 2, 3, 4, 5, 6, 7, 8, 9) is incomplete f = make_func('a: int, b: float') assert check_valid(f) is incomplete assert check_valid(f, 1) is incomplete assert check_valid(f, b=1) is incomplete assert check_valid(f, 1, 2) f = make_func('(a: int, b: float) -> float') assert check_valid(f) is incomplete assert check_valid(f, 1) is incomplete assert check_valid(f, b=1) is incomplete assert check_valid(f, 1, 2) f.__signature__ = 34 assert check_valid(f) is False class RaisesValueError(object): def __call__(self): pass @property def __signature__(self): raise ValueError('Testing Python 3.4') f = RaisesValueError() assert check_valid(f) is None def test_is_partial(): test_is_valid(check_valid=is_partial_args, incomplete=True) test_is_valid_py3(check_valid=is_partial_args, incomplete=True) def test_is_valid_curry(): def check_curry(func, args, kwargs, incomplete=True): try: curry(func)(*args, **kwargs) curry(func, *args)(**kwargs) curry(func, **kwargs)(*args) curry(func, *args, **kwargs)() if not isinstance(func, type(lambda: None)): return None return incomplete except ValueError: return True except TypeError: return False check_valid = functools.partial(check_curry, incomplete=True) test_is_valid(check_valid=check_valid, incomplete=True) test_is_valid_py3(check_valid=check_valid, incomplete=True) check_valid = functools.partial(check_curry, incomplete=False) test_is_valid(check_valid=check_valid, incomplete=False) test_is_valid_py3(check_valid=check_valid, incomplete=False) def test_func_keyword(): def f(func=None): pass assert is_valid_args(f, (), {}) assert is_valid_args(f, (None,), {}) assert is_valid_args(f, (), {'func': None}) assert is_valid_args(f, (None,), {'func': None}) is False assert is_partial_args(f, (), {}) assert is_partial_args(f, (None,), {}) assert is_partial_args(f, (), {'func': None}) assert is_partial_args(f, (None,), {'func': None}) is False def test_has_unknown_args(): assert has_varargs(1) is False assert has_varargs(map) assert has_varargs(make_func('')) is False assert has_varargs(make_func('x, y, z')) is False assert has_varargs(make_func('*args')) assert has_varargs(make_func('**kwargs')) is False assert has_varargs(make_func('x, y, *args, **kwargs')) assert has_varargs(make_func('x, y, z=1')) is False assert has_varargs(make_func('x, y, z=1, **kwargs')) is False if PY3: f = make_func('*args') f.__signature__ = 34 assert has_varargs(f) is False class RaisesValueError(object): def __call__(self): pass @property def __signature__(self): raise ValueError('Testing Python 3.4') f = RaisesValueError() assert has_varargs(f) is None def test_num_required_args(): assert num_required_args(lambda: None) == 0 assert num_required_args(lambda x: None) == 1 assert num_required_args(lambda x, *args: None) == 1 assert num_required_args(lambda x, **kwargs: None) == 1 assert num_required_args(lambda x, y, *args, **kwargs: None) == 2 assert num_required_args(map) == 2 assert num_required_args(dict) is None def test_has_keywords(): assert has_keywords(lambda: None) is False assert has_keywords(lambda x: None) is False assert has_keywords(lambda x=1: None) assert has_keywords(lambda **kwargs: None) assert has_keywords(int) assert has_keywords(sorted) assert has_keywords(max) assert has_keywords(map) is False assert has_keywords(bytearray) is None def test_has_varargs(): assert has_varargs(lambda: None) is False assert has_varargs(lambda *args: None) assert has_varargs(lambda **kwargs: None) is False assert has_varargs(map) if PY3: assert has_varargs(max) is None def test_is_arity(): assert is_arity(0, lambda: None) assert is_arity(1, lambda: None) is False assert is_arity(1, lambda x: None) assert is_arity(3, lambda x, y, z: None) assert is_arity(1, lambda x, *args: None) is False assert is_arity(1, lambda x, **kwargs: None) is False assert is_arity(1, all) assert is_arity(2, map) is False assert is_arity(2, range) is None def test_introspect_curry_valid_py3(check_valid=is_valid_args, incomplete=False): if not PY3: return orig_check_valid = check_valid check_valid = lambda _func, *args, **kwargs: orig_check_valid(_func, args, kwargs) f = cytoolz.curry(make_func('x, y, z=0')) assert check_valid(f) assert check_valid(f, 1) assert check_valid(f, 1, 2) assert check_valid(f, 1, 2, 3) assert check_valid(f, 1, 2, 3, 4) is False assert check_valid(f, invalid_keyword=True) is False assert check_valid(f(1)) assert check_valid(f(1), 2) assert check_valid(f(1), 2, 3) assert check_valid(f(1), 2, 3, 4) is False assert check_valid(f(1), x=2) is False assert check_valid(f(1), y=2) assert check_valid(f(x=1), 2) is False assert check_valid(f(x=1), y=2) assert check_valid(f(y=2), 1) assert check_valid(f(y=2), 1, z=3) assert check_valid(f(y=2), 1, 3) is False f = cytoolz.curry(make_func('x, y, z=0'), 1, x=1) assert check_valid(f) is False assert check_valid(f, z=3) is False f = cytoolz.curry(make_func('x, y, *args, z')) assert check_valid(f) assert check_valid(f, 0) assert check_valid(f(1), 0) assert check_valid(f(1, 2), 0) assert check_valid(f(1, 2, 3), 0) assert check_valid(f(1, 2, 3, 4), 0) assert check_valid(f(1, 2, 3, 4), z=4) assert check_valid(f(x=1)) assert check_valid(f(x=1), 1) is False assert check_valid(f(x=1), y=2) def test_introspect_curry_partial_py3(): test_introspect_curry_valid_py3(check_valid=is_partial_args, incomplete=True) def test_introspect_curry_py3(): if not PY3: return f = cytoolz.curry(make_func('')) assert num_required_args(f) == 0 assert is_arity(0, f) assert has_varargs(f) is False assert has_keywords(f) is False f = cytoolz.curry(make_func('x')) assert num_required_args(f) == 0 assert is_arity(0, f) is False assert is_arity(1, f) is False assert has_varargs(f) is False assert has_keywords(f) # A side-effect of being curried f = cytoolz.curry(make_func('x, y, z=0')) assert num_required_args(f) == 0 assert is_arity(0, f) is False assert is_arity(1, f) is False assert is_arity(2, f) is False assert is_arity(3, f) is False assert has_varargs(f) is False assert has_keywords(f) f = cytoolz.curry(make_func('*args, **kwargs')) assert num_required_args(f) == 0 assert has_varargs(f) assert has_keywords(f) def test_introspect_builtin_modules(): mods = [builtins, functools, itertools, operator, cytoolz, cytoolz.functoolz, cytoolz.itertoolz, cytoolz.dicttoolz, cytoolz.recipes] blacklist = set() def add_blacklist(mod, attr): if hasattr(mod, attr): blacklist.add(getattr(mod, attr)) add_blacklist(builtins, 'basestring') add_blacklist(builtins, 'NoneType') add_blacklist(builtins, '__metaclass__') add_blacklist(builtins, 'sequenceiterator') def is_missing(modname, name, func): if name.startswith('_') and not name.startswith('__'): return False if name.startswith('__pyx_unpickle_') or name.endswith('_cython__'): return False try: if issubclass(func, BaseException): return False except TypeError: pass try: return (callable(func) and func.__module__ is not None and modname in func.__module__ and is_partial_args(func, (), {}) is not True and func not in blacklist) except AttributeError: return False missing = {} for mod in mods: modname = mod.__name__ for name, func in vars(mod).items(): if is_missing(modname, name, func): if modname not in missing: missing[modname] = [] missing[modname].append(name) if missing: messages = [] for modname, names in sorted(missing.items()): msg = '{}:\n {}'.format(modname, '\n '.join(sorted(names))) messages.append(msg) message = 'Missing introspection for the following callables:\n\n' raise AssertionError(message + '\n\n'.join(messages)) def test_inspect_signature_property(): if not PY3: return # By adding AddX to our signature registry, we can inspect the class # itself and objects of the class. `inspect.signature` doesn't like # it when `obj.__signature__` is a property. class AddX(object): def __init__(self, func): self.func = func def __call__(self, addx, *args, **kwargs): return addx + self.func(*args, **kwargs) @property def __signature__(self): sig = inspect.signature(self.func) params = list(sig.parameters.values()) kind = inspect.Parameter.POSITIONAL_OR_KEYWORD newparam = inspect.Parameter('addx', kind) params = [newparam] + params return sig.replace(parameters=params) addx = AddX(lambda x: x) sig = inspect.signature(addx) assert sig == inspect.Signature(parameters=[ inspect.Parameter('addx', inspect.Parameter.POSITIONAL_OR_KEYWORD), inspect.Parameter('x', inspect.Parameter.POSITIONAL_OR_KEYWORD)]) assert num_required_args(AddX) is False _sigs.signatures[AddX] = (_sigs.expand_sig((0, lambda func: None)),) assert num_required_args(AddX) == 1 del _sigs.signatures[AddX] def test_inspect_wrapped_property(): class Wrapped(object): def __init__(self, func): self.func = func def __call__(self, *args, **kwargs): return self.func(*args, **kwargs) @property def __wrapped__(self): return self.func func = lambda x: x wrapped = Wrapped(func) if PY3: assert inspect.signature(func) == inspect.signature(wrapped) assert num_required_args(Wrapped) is None _sigs.signatures[Wrapped] = (_sigs.expand_sig((0, lambda func: None)),) assert num_required_args(Wrapped) == 1 cytoolz-0.10.1/cytoolz/tests/test_itertoolz.py000066400000000000000000000434451355770264200216320ustar00rootroot00000000000000import itertools from itertools import starmap from cytoolz.utils import raises from functools import partial from random import Random from pickle import dumps, loads from cytoolz.itertoolz import (remove, groupby, merge_sorted, concat, concatv, interleave, unique, isiterable, getter, mapcat, isdistinct, first, second, nth, take, tail, drop, interpose, get, rest, last, cons, frequencies, reduceby, iterate, accumulate, sliding_window, count, partition, partition_all, take_nth, pluck, join, diff, topk, peek, peekn, random_sample) from cytoolz.compatibility import range, filter from operator import add, mul # is comparison will fail between this and no_default no_default2 = loads(dumps('__no__default__')) def identity(x): return x def iseven(x): return x % 2 == 0 def isodd(x): return x % 2 == 1 def inc(x): return x + 1 def double(x): return 2 * x def test_remove(): r = remove(iseven, range(5)) assert type(r) is not list assert list(r) == list(filter(isodd, range(5))) def test_groupby(): assert groupby(iseven, [1, 2, 3, 4]) == {True: [2, 4], False: [1, 3]} def test_groupby_non_callable(): assert groupby(0, [(1, 2), (1, 3), (2, 2), (2, 4)]) == \ {1: [(1, 2), (1, 3)], 2: [(2, 2), (2, 4)]} assert groupby([0], [(1, 2), (1, 3), (2, 2), (2, 4)]) == \ {(1,): [(1, 2), (1, 3)], (2,): [(2, 2), (2, 4)]} assert groupby([0, 0], [(1, 2), (1, 3), (2, 2), (2, 4)]) == \ {(1, 1): [(1, 2), (1, 3)], (2, 2): [(2, 2), (2, 4)]} def test_merge_sorted(): assert list(merge_sorted([1, 2, 3], [1, 2, 3])) == [1, 1, 2, 2, 3, 3] assert list(merge_sorted([1, 3, 5], [2, 4, 6])) == [1, 2, 3, 4, 5, 6] assert list(merge_sorted([1], [2, 4], [3], [])) == [1, 2, 3, 4] assert list(merge_sorted([5, 3, 1], [6, 4, 3], [], key=lambda x: -x)) == [6, 5, 4, 3, 3, 1] assert list(merge_sorted([2, 1, 3], [1, 2, 3], key=lambda x: x // 3)) == [2, 1, 1, 2, 3, 3] assert list(merge_sorted([2, 3], [1, 3], key=lambda x: x // 3)) == [2, 1, 3, 3] assert ''.join(merge_sorted('abc', 'abc', 'abc')) == 'aaabbbccc' assert ''.join(merge_sorted('abc', 'abc', 'abc', key=ord)) == 'aaabbbccc' assert ''.join(merge_sorted('cba', 'cba', 'cba', key=lambda x: -ord(x))) == 'cccbbbaaa' assert list(merge_sorted([1], [2, 3, 4], key=identity)) == [1, 2, 3, 4] data = [[(1, 2), (0, 4), (3, 6)], [(5, 3), (6, 5), (8, 8)], [(9, 1), (9, 8), (9, 9)]] assert list(merge_sorted(*data, key=lambda x: x[1])) == [ (9, 1), (1, 2), (5, 3), (0, 4), (6, 5), (3, 6), (8, 8), (9, 8), (9, 9)] assert list(merge_sorted()) == [] assert list(merge_sorted([1, 2, 3])) == [1, 2, 3] assert list(merge_sorted([1, 4, 5], [2, 3])) == [1, 2, 3, 4, 5] assert list(merge_sorted([1, 4, 5], [2, 3], key=identity)) == [ 1, 2, 3, 4, 5] assert list(merge_sorted([1, 5], [2], [4, 7], [3, 6], key=identity)) == [ 1, 2, 3, 4, 5, 6, 7] def test_interleave(): assert ''.join(interleave(('ABC', '123'))) == 'A1B2C3' assert ''.join(interleave(('ABC', '1'))) == 'A1BC' def test_unique(): assert tuple(unique((1, 2, 3))) == (1, 2, 3) assert tuple(unique((1, 2, 1, 3))) == (1, 2, 3) assert tuple(unique((1, 2, 3), key=iseven)) == (1, 2) def test_isiterable(): assert isiterable([1, 2, 3]) is True assert isiterable('abc') is True assert isiterable(5) is False def test_isdistinct(): assert isdistinct([1, 2, 3]) is True assert isdistinct([1, 2, 1]) is False assert isdistinct("Hello") is False assert isdistinct("World") is True assert isdistinct(iter([1, 2, 3])) is True assert isdistinct(iter([1, 2, 1])) is False def test_nth(): assert nth(2, 'ABCDE') == 'C' assert nth(2, iter('ABCDE')) == 'C' assert nth(1, (3, 2, 1)) == 2 assert nth(0, {'foo': 'bar'}) == 'foo' assert raises(StopIteration, lambda: nth(10, {10: 'foo'})) assert nth(-2, 'ABCDE') == 'D' assert raises(ValueError, lambda: nth(-2, iter('ABCDE'))) def test_first(): assert first('ABCDE') == 'A' assert first((3, 2, 1)) == 3 assert isinstance(first({0: 'zero', 1: 'one'}), int) def test_second(): assert second('ABCDE') == 'B' assert second((3, 2, 1)) == 2 assert isinstance(second({0: 'zero', 1: 'one'}), int) def test_last(): assert last('ABCDE') == 'E' assert last((3, 2, 1)) == 1 assert isinstance(last({0: 'zero', 1: 'one'}), int) def test_rest(): assert list(rest('ABCDE')) == list('BCDE') assert list(rest((3, 2, 1))) == list((2, 1)) def test_take(): assert list(take(3, 'ABCDE')) == list('ABC') assert list(take(2, (3, 2, 1))) == list((3, 2)) def test_tail(): assert list(tail(3, 'ABCDE')) == list('CDE') assert list(tail(3, iter('ABCDE'))) == list('CDE') assert list(tail(2, (3, 2, 1))) == list((2, 1)) def test_drop(): assert list(drop(3, 'ABCDE')) == list('DE') assert list(drop(1, (3, 2, 1))) == list((2, 1)) def test_take_nth(): assert list(take_nth(2, 'ABCDE')) == list('ACE') def test_get(): assert get(1, 'ABCDE') == 'B' assert list(get([1, 3], 'ABCDE')) == list('BD') assert get('a', {'a': 1, 'b': 2, 'c': 3}) == 1 assert get(['a', 'b'], {'a': 1, 'b': 2, 'c': 3}) == (1, 2) assert get('foo', {}, default='bar') == 'bar' assert get({}, [1, 2, 3], default='bar') == 'bar' assert get([0, 2], 'AB', 'C') == ('A', 'C') assert get([0], 'AB') == ('A',) assert get([], 'AB') == () assert raises(IndexError, lambda: get(10, 'ABC')) assert raises(KeyError, lambda: get(10, {'a': 1})) assert raises(TypeError, lambda: get({}, [1, 2, 3])) assert raises(TypeError, lambda: get([1, 2, 3], 1, None)) assert raises(KeyError, lambda: get('foo', {}, default=no_default2)) def test_mapcat(): assert (list(mapcat(identity, [[1, 2, 3], [4, 5, 6]])) == [1, 2, 3, 4, 5, 6]) assert (list(mapcat(reversed, [[3, 2, 1, 0], [6, 5, 4], [9, 8, 7]])) == list(range(10))) inc = lambda i: i + 1 assert ([4, 5, 6, 7, 8, 9] == list(mapcat(partial(map, inc), [[3, 4, 5], [6, 7, 8]]))) def test_cons(): assert list(cons(1, [2, 3])) == [1, 2, 3] def test_concat(): assert list(concat([[], [], []])) == [] assert (list(take(5, concat([['a', 'b'], range(1000000000)]))) == ['a', 'b', 0, 1, 2]) def test_concatv(): assert list(concatv([], [], [])) == [] assert (list(take(5, concatv(['a', 'b'], range(1000000000)))) == ['a', 'b', 0, 1, 2]) def test_interpose(): assert "a" == first(rest(interpose("a", range(1000000000)))) assert "tXaXrXzXaXn" == "".join(interpose("X", "tarzan")) assert list(interpose(0, itertools.repeat(1, 4))) == [1, 0, 1, 0, 1, 0, 1] assert list(interpose('.', ['a', 'b', 'c'])) == ['a', '.', 'b', '.', 'c'] def test_frequencies(): assert (frequencies(["cat", "pig", "cat", "eel", "pig", "dog", "dog", "dog"]) == {"cat": 2, "eel": 1, "pig": 2, "dog": 3}) assert frequencies([]) == {} assert frequencies("onomatopoeia") == {"a": 2, "e": 1, "i": 1, "m": 1, "o": 4, "n": 1, "p": 1, "t": 1} def test_reduceby(): data = [1, 2, 3, 4, 5] iseven = lambda x: x % 2 == 0 assert reduceby(iseven, add, data, 0) == {False: 9, True: 6} assert reduceby(iseven, mul, data, 1) == {False: 15, True: 8} projects = [{'name': 'build roads', 'state': 'CA', 'cost': 1000000}, {'name': 'fight crime', 'state': 'IL', 'cost': 100000}, {'name': 'help farmers', 'state': 'IL', 'cost': 2000000}, {'name': 'help farmers', 'state': 'CA', 'cost': 200000}] assert reduceby(lambda x: x['state'], lambda acc, x: acc + x['cost'], projects, 0) == {'CA': 1200000, 'IL': 2100000} assert reduceby('state', lambda acc, x: acc + x['cost'], projects, 0) == {'CA': 1200000, 'IL': 2100000} def test_reduce_by_init(): assert reduceby(iseven, add, [1, 2, 3, 4]) == {True: 2 + 4, False: 1 + 3} assert reduceby(iseven, add, [1, 2, 3, 4], no_default2) == {True: 2 + 4, False: 1 + 3} def test_reduce_by_callable_default(): def set_add(s, i): s.add(i) return s assert reduceby(iseven, set_add, [1, 2, 3, 4, 1, 2], set) == \ {True: {2, 4}, False: {1, 3}} def test_iterate(): assert list(itertools.islice(iterate(inc, 0), 0, 5)) == [0, 1, 2, 3, 4] assert list(take(4, iterate(double, 1))) == [1, 2, 4, 8] def test_accumulate(): assert list(accumulate(add, [1, 2, 3, 4, 5])) == [1, 3, 6, 10, 15] assert list(accumulate(mul, [1, 2, 3, 4, 5])) == [1, 2, 6, 24, 120] assert list(accumulate(add, [1, 2, 3, 4, 5], -1)) == [-1, 0, 2, 5, 9, 14] def binop(a, b): raise AssertionError('binop should not be called') start = object() assert list(accumulate(binop, [], start)) == [start] assert list(accumulate(binop, [])) == [] assert list(accumulate(add, [1, 2, 3], no_default2)) == [1, 3, 6] def test_accumulate_works_on_consumable_iterables(): assert list(accumulate(add, iter((1, 2, 3)))) == [1, 3, 6] def test_sliding_window(): assert list(sliding_window(2, [1, 2, 3, 4])) == [(1, 2), (2, 3), (3, 4)] assert list(sliding_window(3, [1, 2, 3, 4])) == [(1, 2, 3), (2, 3, 4)] def test_sliding_window_of_short_iterator(): assert list(sliding_window(3, [1, 2])) == [] assert list(sliding_window(7, [1, 2])) == [] def test_partition(): assert list(partition(2, [1, 2, 3, 4])) == [(1, 2), (3, 4)] assert list(partition(3, range(7))) == [(0, 1, 2), (3, 4, 5)] assert list(partition(3, range(4), pad=-1)) == [(0, 1, 2), (3, -1, -1)] assert list(partition(2, [])) == [] def test_partition_all(): assert list(partition_all(2, [1, 2, 3, 4])) == [(1, 2), (3, 4)] assert list(partition_all(3, range(5))) == [(0, 1, 2), (3, 4)] assert list(partition_all(2, [])) == [] # Regression test: https://github.com/pycytoolz/cytoolz/issues/387 class NoCompare(object): def __eq__(self, other): if self.__class__ == other.__class__: return True raise ValueError() obj = NoCompare() result = [(obj, obj, obj, obj), (obj, obj, obj)] assert list(partition_all(4, [obj]*7)) == result assert list(partition_all(4, iter([obj]*7))) == result def test_count(): assert count((1, 2, 3)) == 3 assert count([]) == 0 assert count(iter((1, 2, 3, 4))) == 4 assert count('hello') == 5 assert count(iter('hello')) == 5 def test_pluck(): assert list(pluck(0, [[0, 1], [2, 3], [4, 5]])) == [0, 2, 4] assert list(pluck([0, 1], [[0, 1, 2], [3, 4, 5]])) == [(0, 1), (3, 4)] assert list(pluck(1, [[0], [0, 1]], None)) == [None, 1] data = [{'id': 1, 'name': 'cheese'}, {'id': 2, 'name': 'pies', 'price': 1}] assert list(pluck('id', data)) == [1, 2] assert list(pluck('price', data, 0)) == [0, 1] assert list(pluck(['id', 'name'], data)) == [(1, 'cheese'), (2, 'pies')] assert list(pluck(['name'], data)) == [('cheese',), ('pies',)] assert list(pluck(['price', 'other'], data, 0)) == [(0, 0), (1, 0)] assert raises(IndexError, lambda: list(pluck(1, [[0]]))) assert raises(KeyError, lambda: list(pluck('name', [{'id': 1}]))) assert list(pluck(0, [[0, 1], [2, 3], [4, 5]], no_default2)) == [0, 2, 4] assert raises(IndexError, lambda: list(pluck(1, [[0]], no_default2))) def test_join(): names = [(1, 'one'), (2, 'two'), (3, 'three')] fruit = [('apple', 1), ('orange', 1), ('banana', 2), ('coconut', 2)] def addpair(pair): return pair[0] + pair[1] result = set(starmap(add, join(first, names, second, fruit))) expected = {(1, 'one', 'apple', 1), (1, 'one', 'orange', 1), (2, 'two', 'banana', 2), (2, 'two', 'coconut', 2)} assert result == expected result = set(starmap(add, join(first, names, second, fruit, left_default=no_default2, right_default=no_default2))) assert result == expected def test_getter(): assert getter(0)('Alice') == 'A' assert getter([0])('Alice') == ('A',) assert getter([])('Alice') == () def test_key_as_getter(): squares = [(i, i**2) for i in range(5)] pows = [(i, i**2, i**3) for i in range(5)] assert set(join(0, squares, 0, pows)) == set(join(lambda x: x[0], squares, lambda x: x[0], pows)) get = lambda x: (x[0], x[1]) assert set(join([0, 1], squares, [0, 1], pows)) == set(join(get, squares, get, pows)) get = lambda x: (x[0],) assert set(join([0], squares, [0], pows)) == set(join(get, squares, get, pows)) def test_join_double_repeats(): names = [(1, 'one'), (2, 'two'), (3, 'three'), (1, 'uno'), (2, 'dos')] fruit = [('apple', 1), ('orange', 1), ('banana', 2), ('coconut', 2)] result = set(starmap(add, join(first, names, second, fruit))) expected = {(1, 'one', 'apple', 1), (1, 'one', 'orange', 1), (2, 'two', 'banana', 2), (2, 'two', 'coconut', 2), (1, 'uno', 'apple', 1), (1, 'uno', 'orange', 1), (2, 'dos', 'banana', 2), (2, 'dos', 'coconut', 2)} assert result == expected def test_join_missing_element(): names = [(1, 'one'), (2, 'two'), (3, 'three')] fruit = [('apple', 5), ('orange', 1)] result = set(starmap(add, join(first, names, second, fruit))) expected = {(1, 'one', 'orange', 1)} assert result == expected def test_left_outer_join(): result = set(join(identity, [1, 2], identity, [2, 3], left_default=None)) expected = {(2, 2), (None, 3)} assert result == expected def test_right_outer_join(): result = set(join(identity, [1, 2], identity, [2, 3], right_default=None)) expected = {(2, 2), (1, None)} assert result == expected def test_outer_join(): result = set(join(identity, [1, 2], identity, [2, 3], left_default=None, right_default=None)) expected = {(2, 2), (1, None), (None, 3)} assert result == expected def test_diff(): assert raises(TypeError, lambda: list(diff())) assert raises(TypeError, lambda: list(diff([1, 2]))) assert raises(TypeError, lambda: list(diff([1, 2], 3))) assert list(diff([1, 2], (1, 2), iter([1, 2]))) == [] assert list(diff([1, 2, 3], (1, 10, 3), iter([1, 2, 10]))) == [ (2, 10, 2), (3, 3, 10)] assert list(diff([1, 2], [10])) == [(1, 10)] assert list(diff([1, 2], [10], default=None)) == [(1, 10), (2, None)] # non-variadic usage assert raises(TypeError, lambda: list(diff([]))) assert raises(TypeError, lambda: list(diff([[]]))) assert raises(TypeError, lambda: list(diff([[1, 2]]))) assert raises(TypeError, lambda: list(diff([[1, 2], 3]))) assert list(diff([(1, 2), (1, 3)])) == [(2, 3)] data1 = [{'cost': 1, 'currency': 'dollar'}, {'cost': 2, 'currency': 'dollar'}] data2 = [{'cost': 100, 'currency': 'yen'}, {'cost': 300, 'currency': 'yen'}] conversions = {'dollar': 1, 'yen': 0.01} def indollars(item): return conversions[item['currency']] * item['cost'] list(diff(data1, data2, key=indollars)) == [ ({'cost': 2, 'currency': 'dollar'}, {'cost': 300, 'currency': 'yen'})] def test_topk(): assert topk(2, [4, 1, 5, 2]) == (5, 4) assert topk(2, [4, 1, 5, 2], key=lambda x: -x) == (1, 2) assert topk(2, iter([5, 1, 4, 2]), key=lambda x: -x) == (1, 2) assert topk(2, [{'a': 1, 'b': 10}, {'a': 2, 'b': 9}, {'a': 10, 'b': 1}, {'a': 9, 'b': 2}], key='a') == \ ({'a': 10, 'b': 1}, {'a': 9, 'b': 2}) assert topk(2, [{'a': 1, 'b': 10}, {'a': 2, 'b': 9}, {'a': 10, 'b': 1}, {'a': 9, 'b': 2}], key='b') == \ ({'a': 1, 'b': 10}, {'a': 2, 'b': 9}) assert topk(2, [(0, 4), (1, 3), (2, 2), (3, 1), (4, 0)], 0) == \ ((4, 0), (3, 1)) def test_topk_is_stable(): assert topk(4, [5, 9, 2, 1, 5, 3], key=lambda x: 1) == (5, 9, 2, 1) def test_peek(): alist = ["Alice", "Bob", "Carol"] element, blist = peek(alist) assert element == alist[0] assert list(blist) == alist assert raises(StopIteration, lambda: peek([])) def test_peekn(): alist = ("Alice", "Bob", "Carol") elements, blist = peekn(2, alist) assert elements == alist[:2] assert tuple(blist) == alist elements, blist = peekn(len(alist) * 4, alist) assert elements == alist assert tuple(blist) == alist def test_random_sample(): alist = list(range(100)) assert list(random_sample(prob=1, seq=alist, random_state=2016)) == alist mk_rsample = lambda rs=1: list(random_sample(prob=0.1, seq=alist, random_state=rs)) rsample1 = mk_rsample() assert rsample1 == mk_rsample() rsample2 = mk_rsample(1984) randobj = Random(1984) assert rsample2 == mk_rsample(randobj) assert rsample1 != rsample2 assert mk_rsample(object) == mk_rsample(object) assert mk_rsample(object) != mk_rsample(object()) assert mk_rsample(b"a") == mk_rsample(u"a") assert raises(TypeError, lambda: mk_rsample([])) cytoolz-0.10.1/cytoolz/tests/test_none_safe.py000066400000000000000000000276761355770264200215440ustar00rootroot00000000000000""" Test that functions are reasonably behaved with None as input. Typed Cython objects (like dict) may also be None. Using functions from Python's C API that expect a specific type but receive None instead can cause problems such as throwing an uncatchable SystemError (and some systems may segfault instead). We obviously don't what that to happen! As the tests below discovered, this turned out to be a rare occurence. The only changes required were to use `d.copy()` instead of `PyDict_Copy(d)`, and to always return Python objects from functions instead of int or bint (so exceptions can propagate). The vast majority of functions throw TypeError. The vast majority of functions also behave the same in `toolz` and `cytoolz`. However, there are a few minor exceptions. Since passing None to functions are edge cases that don't have well-established behavior yet (other than raising TypeError), the tests in this file serve to verify that the behavior is at least reasonably well-behaved and don't cause SystemErrors. """ # XXX: This file could be back-ported to `toolz` once unified testing exists. import cytoolz from cytoolz import * from cytoolz.utils import raises from operator import add class GenException(object): def __init__(self, exc): self.exc = exc def __iter__(self): return self def __next__(self): raise self.exc def next(self): raise self.exc def test_dicttoolz(): tested = [] assert raises((TypeError, AttributeError), lambda: assoc(None, 1, 2)) tested.append('assoc') assert raises((TypeError, AttributeError), lambda: dissoc(None, 1)) tested.append('dissoc') # XXX assert (raises(TypeError, lambda: get_in(None, {})) or get_in(None, {}) is None) assert raises(TypeError, lambda: get_in(None, {}, no_default=True)) assert get_in([0, 1], None) is None assert raises(TypeError, lambda: get_in([0, 1], None, no_default=True)) tested.append('get_in') assert raises(TypeError, lambda: keyfilter(None, {1: 2})) assert raises((AttributeError, TypeError), lambda: keyfilter(identity, None)) tested.append('keyfilter') # XXX assert (raises(TypeError, lambda: keymap(None, {1: 2})) or keymap(None, {1: 2}) == {(1,): 2}) assert raises((AttributeError, TypeError), lambda: keymap(identity, None)) tested.append('keymap') assert raises(TypeError, lambda: merge(None)) assert raises((TypeError, AttributeError), lambda: merge(None, None)) tested.append('merge') assert raises(TypeError, lambda: merge_with(None, {1: 2}, {3: 4})) assert raises(TypeError, lambda: merge_with(identity, None)) assert raises((TypeError, AttributeError), lambda: merge_with(identity, None, None)) tested.append('merge_with') assert raises(TypeError, lambda: update_in({1: {2: 3}}, [1, 2], None)) assert raises(TypeError, lambda: update_in({1: {2: 3}}, None, identity)) assert raises((TypeError, AttributeError), lambda: update_in(None, [1, 2], identity)) tested.append('update_in') assert raises(TypeError, lambda: valfilter(None, {1: 2})) assert raises((AttributeError, TypeError), lambda: valfilter(identity, None)) tested.append('valfilter') # XXX assert (raises(TypeError, lambda: valmap(None, {1: 2})) or valmap(None, {1: 2}) == {1: (2,)}) assert raises((AttributeError, TypeError), lambda: valmap(identity, None)) tested.append('valmap') assert (raises(TypeError, lambda: itemmap(None, {1: 2})) or itemmap(None, {1: 2}) == {1: (2,)}) assert raises((AttributeError, TypeError), lambda: itemmap(identity, None)) tested.append('itemmap') assert raises(TypeError, lambda: itemfilter(None, {1: 2})) assert raises((AttributeError, TypeError), lambda: itemfilter(identity, None)) tested.append('itemfilter') assert raises((AttributeError, TypeError), lambda: assoc_in(None, [2, 2], 3)) assert raises(TypeError, lambda: assoc_in({}, None, 3)) tested.append('assoc_in') s1 = set(tested) s2 = set(cytoolz.dicttoolz.__all__) assert s1 == s2, '%s not tested for being None-safe' % ', '.join(s2 - s1) def test_functoolz(): tested = [] assert raises(TypeError, lambda: complement(None)()) tested.append('complement') assert compose(None) is None assert raises(TypeError, lambda: compose(None, None)()) tested.append('compose') assert compose_left(None) is None assert raises(TypeError, lambda: compose_left(None, None)()) tested.append('compose_left') assert raises(TypeError, lambda: curry(None)) tested.append('curry') assert raises(TypeError, lambda: do(None, 1)) tested.append('do') assert identity(None) is None tested.append('identity') assert raises(TypeError, lambda: juxt(None)) assert raises(TypeError, lambda: list(juxt(None, None)())) tested.append('juxt') assert memoize(identity, key=None)(1) == 1 assert memoize(identity, cache=None)(1) == 1 tested.append('memoize') assert raises(TypeError, lambda: pipe(1, None)) tested.append('pipe') assert thread_first(1, None) is None tested.append('thread_first') assert thread_last(1, None) is None tested.append('thread_last') assert flip(lambda a, b: (a, b))(None)(None) == (None, None) tested.append('flip') assert apply(identity, None) is None assert raises(TypeError, lambda: apply(None)) tested.append('apply') excepts(None, lambda x: x) excepts(TypeError, None) tested.append('excepts') s1 = set(tested) s2 = set(cytoolz.functoolz.__all__) assert s1 == s2, '%s not tested for being None-safe' % ', '.join(s2 - s1) def test_itertoolz(): tested = [] assert raises(TypeError, lambda: list(accumulate(None, [1, 2]))) assert raises(TypeError, lambda: list(accumulate(identity, None))) tested.append('accumulate') assert raises(TypeError, lambda: concat(None)) assert raises(TypeError, lambda: list(concat([None]))) tested.append('concat') assert raises(TypeError, lambda: list(concatv(None))) tested.append('concatv') assert raises(TypeError, lambda: list(cons(1, None))) tested.append('cons') assert raises(TypeError, lambda: count(None)) tested.append('count') # XXX assert (raises(TypeError, lambda: list(drop(None, [1, 2]))) or list(drop(None, [1, 2])) == [1, 2]) assert raises(TypeError, lambda: list(drop(1, None))) tested.append('drop') assert raises(TypeError, lambda: first(None)) tested.append('first') assert raises(TypeError, lambda: frequencies(None)) tested.append('frequencies') assert raises(TypeError, lambda: get(1, None)) assert raises(TypeError, lambda: get([1, 2], None)) tested.append('get') assert raises(TypeError, lambda: groupby(None, [1, 2])) assert raises(TypeError, lambda: groupby(identity, None)) tested.append('groupby') assert raises(TypeError, lambda: list(interleave(None))) assert raises(TypeError, lambda: list(interleave([None, None]))) assert raises(TypeError, lambda: list(interleave([[1, 2], GenException(ValueError)], pass_exceptions=None))) tested.append('interleave') assert raises(TypeError, lambda: list(interpose(1, None))) tested.append('interpose') assert raises(TypeError, lambda: isdistinct(None)) tested.append('isdistinct') assert isiterable(None) is False tested.append('isiterable') assert raises(TypeError, lambda: list(iterate(None, 1))) tested.append('iterate') assert raises(TypeError, lambda: last(None)) tested.append('last') # XXX assert (raises(TypeError, lambda: list(mapcat(None, [[1], [2]]))) or list(mapcat(None, [[1], [2]])) == [[1], [2]]) assert raises(TypeError, lambda: list(mapcat(identity, [None, [2]]))) assert raises(TypeError, lambda: list(mapcat(identity, None))) tested.append('mapcat') assert raises(TypeError, lambda: list(merge_sorted(None, [1, 2]))) tested.append('merge_sorted') assert raises(TypeError, lambda: nth(None, [1, 2])) assert raises(TypeError, lambda: nth(0, None)) tested.append('nth') assert raises(TypeError, lambda: partition(None, [1, 2, 3])) assert raises(TypeError, lambda: partition(1, None)) tested.append('partition') assert raises(TypeError, lambda: list(partition_all(None, [1, 2, 3]))) assert raises(TypeError, lambda: list(partition_all(1, None))) tested.append('partition_all') assert raises(TypeError, lambda: list(pluck(None, [[1], [2]]))) assert raises(TypeError, lambda: list(pluck(0, [None, [2]]))) assert raises(TypeError, lambda: list(pluck(0, None))) tested.append('pluck') assert raises(TypeError, lambda: reduceby(None, add, [1, 2, 3], 0)) assert raises(TypeError, lambda: reduceby(identity, None, [1, 2, 3], 0)) assert raises(TypeError, lambda: reduceby(identity, add, None, 0)) tested.append('reduceby') assert raises(TypeError, lambda: list(remove(None, [1, 2]))) assert raises(TypeError, lambda: list(remove(identity, None))) tested.append('remove') assert raises(TypeError, lambda: second(None)) tested.append('second') # XXX assert (raises(TypeError, lambda: list(sliding_window(None, [1, 2, 3]))) or list(sliding_window(None, [1, 2, 3])) == []) assert raises(TypeError, lambda: list(sliding_window(1, None))) tested.append('sliding_window') # XXX assert (raises(TypeError, lambda: list(take(None, [1, 2])) == [1, 2]) or list(take(None, [1, 2])) == [1, 2]) assert raises(TypeError, lambda: list(take(1, None))) tested.append('take') # XXX assert (raises(TypeError, lambda: list(tail(None, [1, 2])) == [1, 2]) or list(tail(None, [1, 2])) == [1, 2]) assert raises(TypeError, lambda: list(tail(1, None))) tested.append('tail') # XXX assert (raises(TypeError, lambda: list(take_nth(None, [1, 2]))) or list(take_nth(None, [1, 2])) == [1, 2]) assert raises(TypeError, lambda: list(take_nth(1, None))) tested.append('take_nth') assert raises(TypeError, lambda: list(unique(None))) assert list(unique([1, 1, 2], key=None)) == [1, 2] tested.append('unique') assert raises(TypeError, lambda: join(first, None, second, (1, 2, 3))) assert raises(TypeError, lambda: join(first, (1, 2, 3), second, None)) tested.append('join') assert raises(TypeError, lambda: topk(None, [1, 2, 3])) assert raises(TypeError, lambda: topk(3, None)) tested.append('topk') assert raises(TypeError, lambda: list(diff(None, [1, 2, 3]))) assert raises(TypeError, lambda: list(diff(None))) assert raises(TypeError, lambda: list(diff([None]))) assert raises(TypeError, lambda: list(diff([None, None]))) tested.append('diff') assert raises(TypeError, lambda: peek(None)) tested.append('peek') assert raises(TypeError, lambda: peekn(None, [1, 2, 3])) assert raises(TypeError, lambda: peekn(3, None)) tested.append('peekn') assert raises(TypeError, lambda: list(random_sample(None, [1]))) assert raises(TypeError, lambda: list(random_sample(0.1, None))) tested.append('random_sample') s1 = set(tested) s2 = set(cytoolz.itertoolz.__all__) assert s1 == s2, '%s not tested for being None-safe' % ', '.join(s2 - s1) def test_recipes(): tested = [] # XXX assert (raises(TypeError, lambda: countby(None, [1, 2])) or countby(None, [1, 2]) == {(1,): 1, (2,): 1}) assert raises(TypeError, lambda: countby(identity, None)) tested.append('countby') # XXX assert (raises(TypeError, lambda: list(partitionby(None, [1, 2]))) or list(partitionby(None, [1, 2])) == [(1,), (2,)]) assert raises(TypeError, lambda: list(partitionby(identity, None))) tested.append('partitionby') s1 = set(tested) s2 = set(cytoolz.recipes.__all__) assert s1 == s2, '%s not tested for being None-safe' % ', '.join(s2 - s1) cytoolz-0.10.1/cytoolz/tests/test_recipes.py000066400000000000000000000014661355770264200212260ustar00rootroot00000000000000from cytoolz import first, identity, countby, partitionby def iseven(x): return x % 2 == 0 def test_countby(): assert countby(iseven, [1, 2, 3]) == {True: 1, False: 2} assert countby(len, ['cat', 'dog', 'mouse']) == {3: 2, 5: 1} assert countby(0, ('ab', 'ac', 'bc')) == {'a': 2, 'b': 1} def test_partitionby(): assert list(partitionby(identity, [])) == [] vowels = "aeiou" assert (list(partitionby(vowels.__contains__, "abcdefghi")) == [("a",), ("b", "c", "d"), ("e",), ("f", "g", "h"), ("i",)]) assert (list(map(first, partitionby(identity, [1, 1, 1, 2, 3, 3, 2, 2, 3]))) == [1, 2, 3, 2, 3]) assert ''.join(map(first, partitionby(identity, "Khhhaaaaannnnn!!!!"))) == 'Khan!' cytoolz-0.10.1/cytoolz/tests/test_serialization.py000066400000000000000000000134061355770264200224460ustar00rootroot00000000000000from cytoolz import * import cytoolz import cytoolz.curried import pickle from cytoolz.compatibility import PY3 from cytoolz.utils import raises def test_compose(): f = compose(str, sum) g = pickle.loads(pickle.dumps(f)) assert f((1, 2)) == g((1, 2)) def test_curry(): f = curry(map)(str) g = pickle.loads(pickle.dumps(f)) assert list(f((1, 2, 3))) == list(g((1, 2, 3))) def test_juxt(): f = juxt(str, int, bool) g = pickle.loads(pickle.dumps(f)) assert f(1) == g(1) assert f.funcs == g.funcs def test_complement(): f = complement(bool) assert f(True) is False assert f(False) is True g = pickle.loads(pickle.dumps(f)) assert f(True) == g(True) assert f(False) == g(False) def test_instanceproperty(): p = cytoolz.functoolz.InstanceProperty(bool) assert p.__get__(None) is None assert p.__get__(0) is False assert p.__get__(1) is True p2 = pickle.loads(pickle.dumps(p)) assert p2.__get__(None) is None assert p2.__get__(0) is False assert p2.__get__(1) is True def f(x, y): return x, y def test_flip(): flip = pickle.loads(pickle.dumps(cytoolz.functoolz.flip)) assert flip is cytoolz.functoolz.flip g1 = flip(f) g2 = pickle.loads(pickle.dumps(g1)) assert g1(1, 2) == g2(1, 2) == f(2, 1) g1 = flip(f)(1) g2 = pickle.loads(pickle.dumps(g1)) assert g1(2) == g2(2) == f(2, 1) def test_curried_exceptions(): # This tests a global curried object that isn't defined in cytoolz.functoolz merge = pickle.loads(pickle.dumps(cytoolz.curried.merge)) assert merge is cytoolz.curried.merge @cytoolz.curry class GlobalCurried(object): def __init__(self, x, y): self.x = x self.y = y @cytoolz.curry def f1(self, a, b): return self.x + self.y + a + b def g1(self): pass def __reduce__(self): """Allow us to serialize instances of GlobalCurried""" return GlobalCurried, (self.x, self.y) @cytoolz.curry class NestedCurried(object): def __init__(self, x, y): self.x = x self.y = y @cytoolz.curry def f2(self, a, b): return self.x + self.y + a + b def g2(self): pass def __reduce__(self): """Allow us to serialize instances of NestedCurried""" return GlobalCurried.NestedCurried, (self.x, self.y) class Nested(object): def __init__(self, x, y): self.x = x self.y = y @cytoolz.curry def f3(self, a, b): return self.x + self.y + a + b def g3(self): pass def test_curried_qualname(): if not PY3: return def preserves_identity(obj): return pickle.loads(pickle.dumps(obj)) is obj assert preserves_identity(GlobalCurried) assert preserves_identity(GlobalCurried.func.f1) assert preserves_identity(GlobalCurried.func.NestedCurried) assert preserves_identity(GlobalCurried.func.NestedCurried.func.f2) assert preserves_identity(GlobalCurried.func.Nested.f3) global_curried1 = GlobalCurried(1) global_curried2 = pickle.loads(pickle.dumps(global_curried1)) assert global_curried1 is not global_curried2 assert global_curried1(2).f1(3, 4) == global_curried2(2).f1(3, 4) == 10 global_curried3 = global_curried1(2) global_curried4 = pickle.loads(pickle.dumps(global_curried3)) assert global_curried3 is not global_curried4 assert global_curried3.f1(3, 4) == global_curried4.f1(3, 4) == 10 func1 = global_curried1(2).f1(3) func2 = pickle.loads(pickle.dumps(func1)) assert func1 is not func2 assert func1(4) == func2(4) == 10 nested_curried1 = GlobalCurried.func.NestedCurried(1) nested_curried2 = pickle.loads(pickle.dumps(nested_curried1)) assert nested_curried1 is not nested_curried2 assert nested_curried1(2).f2(3, 4) == nested_curried2(2).f2(3, 4) == 10 # If we add `curry.__getattr__` forwarding, the following tests will pass # if not PY34: # assert preserves_identity(GlobalCurried.func.g1) # assert preserves_identity(GlobalCurried.func.NestedCurried.func.g2) # assert preserves_identity(GlobalCurried.func.Nested) # assert preserves_identity(GlobalCurried.func.Nested.g3) # # # Rely on curry.__getattr__ # assert preserves_identity(GlobalCurried.f1) # assert preserves_identity(GlobalCurried.NestedCurried) # assert preserves_identity(GlobalCurried.NestedCurried.f2) # assert preserves_identity(GlobalCurried.Nested.f3) # if not PY34: # assert preserves_identity(GlobalCurried.g1) # assert preserves_identity(GlobalCurried.NestedCurried.g2) # assert preserves_identity(GlobalCurried.Nested) # assert preserves_identity(GlobalCurried.Nested.g3) # # nested_curried3 = nested_curried1(2) # nested_curried4 = pickle.loads(pickle.dumps(nested_curried3)) # assert nested_curried3 is not nested_curried4 # assert nested_curried3.f2(3, 4) == nested_curried4.f2(3, 4) == 10 # # func1 = nested_curried1(2).f2(3) # func2 = pickle.loads(pickle.dumps(func1)) # assert func1 is not func2 # assert func1(4) == func2(4) == 10 # # if not PY34: # nested3 = GlobalCurried.func.Nested(1, 2) # nested4 = pickle.loads(pickle.dumps(nested3)) # assert nested3 is not nested4 # assert nested3.f3(3, 4) == nested4.f3(3, 4) == 10 # # func1 = nested3.f3(3) # func2 = pickle.loads(pickle.dumps(func1)) # assert func1 is not func2 # assert func1(4) == func2(4) == 10 def test_curried_bad_qualname(): @cytoolz.curry class Bad(object): __qualname__ = 'cytoolz.functoolz.not.a.valid.path' assert raises(pickle.PicklingError, lambda: pickle.dumps(Bad)) cytoolz-0.10.1/cytoolz/tests/test_signatures.py000066400000000000000000000055651355770264200217640ustar00rootroot00000000000000import functools import cytoolz._signatures as _sigs from cytoolz._signatures import builtins, _is_valid_args, _is_partial_args from cytoolz.compatibility import PY3 def test_is_valid(check_valid=_is_valid_args, incomplete=False): orig_check_valid = check_valid check_valid = lambda func, *args, **kwargs: orig_check_valid(func, args, kwargs) assert check_valid(lambda x: None) is None f = builtins.abs assert check_valid(f) is incomplete assert check_valid(f, 1) assert check_valid(f, x=1) is False assert check_valid(f, 1, 2) is False f = builtins.complex assert check_valid(f) assert check_valid(f, 1) assert check_valid(f, real=1) assert check_valid(f, 1, 2) assert check_valid(f, 1, imag=2) assert check_valid(f, 1, real=2) is False assert check_valid(f, 1, 2, 3) is False assert check_valid(f, 1, 2, imag=3) is False f = builtins.int assert check_valid(f) assert check_valid(f, 1) assert check_valid(f, x=1) assert check_valid(f, 1, 2) assert check_valid(f, 1, base=2) assert check_valid(f, x=1, base=2) assert check_valid(f, base=2) is incomplete assert check_valid(f, 1, 2, 3) is False f = builtins.map assert check_valid(f) is incomplete assert check_valid(f, 1) is incomplete assert check_valid(f, 1, 2) assert check_valid(f, 1, 2, 3) assert check_valid(f, 1, 2, 3, 4) f = builtins.min assert check_valid(f) is incomplete assert check_valid(f, 1) assert check_valid(f, iterable=1) is False assert check_valid(f, 1, 2) assert check_valid(f, 1, 2, 3) assert check_valid(f, key=None) is incomplete assert check_valid(f, 1, key=None) assert check_valid(f, 1, 2, key=None) assert check_valid(f, 1, 2, 3, key=None) assert check_valid(f, key=None, default=None) is (PY3 and incomplete) assert check_valid(f, 1, key=None, default=None) is PY3 assert check_valid(f, 1, 2, key=None, default=None) is False assert check_valid(f, 1, 2, 3, key=None, default=None) is False f = builtins.range assert check_valid(f) is incomplete assert check_valid(f, 1) assert check_valid(f, 1, 2) assert check_valid(f, 1, 2, 3) assert check_valid(f, 1, 2, step=3) is False assert check_valid(f, 1, 2, 3, 4) is False f = functools.partial assert orig_check_valid(f, (), {}) is incomplete assert orig_check_valid(f, (), {'func': 1}) is incomplete assert orig_check_valid(f, (1,), {}) assert orig_check_valid(f, (1,), {'func': 1}) assert orig_check_valid(f, (1, 2), {}) def test_is_partial(): test_is_valid(check_valid=_is_partial_args, incomplete=True) def test_for_coverage(): # :) assert _sigs._is_arity(1, 1) is None assert _sigs._is_arity(1, all) assert _sigs._has_varargs(None) is None assert _sigs._has_keywords(None) is None assert _sigs._num_required_args(None) is None cytoolz-0.10.1/cytoolz/tests/test_tlz.py000066400000000000000000000027161355770264200204040ustar00rootroot00000000000000import toolz def test_tlz(): import tlz tlz.curry tlz.functoolz.curry assert tlz.__package__ == 'tlz' assert tlz.__name__ == 'tlz' import tlz.curried assert tlz.curried.__package__ == 'tlz.curried' assert tlz.curried.__name__ == 'tlz.curried' tlz.curried.curry import tlz.curried.operator assert tlz.curried.operator.__package__ in (None, 'tlz.curried') assert tlz.curried.operator.__name__ == 'tlz.curried.operator' assert tlz.functoolz.__name__ == 'tlz.functoolz' m1 = tlz.functoolz import tlz.functoolz as m2 assert m1 is m2 import tlz.sandbox try: import tlzthisisabadname.curried 1/0 except ImportError: pass try: import tlz.curry 1/0 except ImportError: pass try: import tlz.badsubmodulename 1/0 except ImportError: pass assert toolz.__package__ == 'toolz' assert toolz.curried.__package__ == 'toolz.curried' assert toolz.functoolz.__name__ == 'toolz.functoolz' import cytoolz assert cytoolz.__package__ == 'cytoolz' assert cytoolz.curried.__package__ == 'cytoolz.curried' assert cytoolz.functoolz.__name__ == 'cytoolz.functoolz' assert tlz.pluck is cytoolz.pluck assert tlz.__file__ == toolz.__file__ assert tlz.functoolz.__file__ == toolz.functoolz.__file__ assert tlz.pipe is toolz.pipe assert 'tlz' in tlz.__doc__ assert tlz.curried.__doc__ is not None cytoolz-0.10.1/cytoolz/tests/test_utils.py000066400000000000000000000006011355770264200207220ustar00rootroot00000000000000from cytoolz.utils import consume, raises def test_raises(): assert raises(ZeroDivisionError, lambda: 1 / 0) assert not raises(ZeroDivisionError, lambda: 1) def test_consume(): l = [1, 2, 3] assert consume(l) is None il = iter(l) assert consume(il) is None assert raises(StopIteration, lambda: next(il)) assert raises(TypeError, lambda: consume(1)) cytoolz-0.10.1/cytoolz/utils.c000066400000000000000000005531131355770264200163260ustar00rootroot00000000000000/* Generated by Cython 0.29.14 */ /* BEGIN: Cython Metadata { "distutils": { "name": "cytoolz.utils", "sources": [ "cytoolz/utils.pyx" ] }, "module_name": "cytoolz.utils" } END: Cython Metadata */ #define PY_SSIZE_T_CLEAN #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 < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) #error Cython requires Python 2.6+ or Python 3.3+. #else #define CYTHON_ABI "0_29_14" #define CYTHON_HEX_VERSION 0x001D0EF0 #define CYTHON_FUTURE_DIVISION 0 #include #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 #define __PYX_COMMA , #ifndef HAVE_LONG_LONG #if PY_VERSION_HEX >= 0x02070000 #define HAVE_LONG_LONG #endif #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_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 0 #undef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 0 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #if PY_VERSION_HEX < 0x03050000 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #undef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #undef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 1 #undef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 0 #undef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 0 #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #elif defined(PYSTON_VERSION) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 1 #define CYTHON_COMPILING_IN_CPYTHON 0 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 #undef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 0 #undef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 0 #undef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_PYSTON 0 #define CYTHON_COMPILING_IN_CPYTHON 1 #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) #define CYTHON_USE_PYTYPE_LOOKUP 1 #endif #if PY_MAJOR_VERSION < 3 #undef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 0 #elif !defined(CYTHON_USE_ASYNC_SLOTS) #define CYTHON_USE_ASYNC_SLOTS 1 #endif #if PY_VERSION_HEX < 0x02070000 #undef CYTHON_USE_PYLONG_INTERNALS #define CYTHON_USE_PYLONG_INTERNALS 0 #elif !defined(CYTHON_USE_PYLONG_INTERNALS) #define CYTHON_USE_PYLONG_INTERNALS 1 #endif #ifndef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 1 #endif #ifndef CYTHON_USE_UNICODE_INTERNALS #define CYTHON_USE_UNICODE_INTERNALS 1 #endif #if PY_VERSION_HEX < 0x030300F0 #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 #elif !defined(CYTHON_USE_UNICODE_WRITER) #define CYTHON_USE_UNICODE_WRITER 1 #endif #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif #ifndef CYTHON_ASSUME_SAFE_MACROS #define CYTHON_ASSUME_SAFE_MACROS 1 #endif #ifndef CYTHON_UNPACK_METHODS #define CYTHON_UNPACK_METHODS 1 #endif #ifndef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 1 #endif #ifndef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 1 #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000) #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) #endif #ifndef CYTHON_USE_DICT_VERSIONS #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1) #endif #ifndef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3) #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) #endif #if CYTHON_USE_PYLONG_INTERNALS #include "longintrepr.h" #undef SHIFT #undef BASE #undef MASK #ifdef SIZEOF_VOID_P enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) }; #endif #endif #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_cpp_attribute #define __has_cpp_attribute(x) 0 #endif #ifndef CYTHON_RESTRICT #if defined(__GNUC__) #define CYTHON_RESTRICT __restrict__ #elif defined(_MSC_VER) && _MSC_VER >= 1400 #define CYTHON_RESTRICT __restrict #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_RESTRICT restrict #else #define CYTHON_RESTRICT #endif #endif #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif #ifndef CYTHON_MAYBE_UNUSED_VAR # if defined(__cplusplus) template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } # else # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) # endif #endif #ifndef CYTHON_NCP_UNUSED # if CYTHON_COMPILING_IN_CPYTHON # define CYTHON_NCP_UNUSED # else # define CYTHON_NCP_UNUSED CYTHON_UNUSED # endif #endif #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) #ifdef _MSC_VER #ifndef _MSC_STDINT_H_ #if _MSC_VER < 1300 typedef unsigned char uint8_t; typedef unsigned int uint32_t; #else typedef unsigned __int8 uint8_t; typedef unsigned __int32 uint32_t; #endif #endif #else #include #endif #ifndef CYTHON_FALLTHROUGH #if defined(__cplusplus) && __cplusplus >= 201103L #if __has_cpp_attribute(fallthrough) #define CYTHON_FALLTHROUGH [[fallthrough]] #elif __has_cpp_attribute(clang::fallthrough) #define CYTHON_FALLTHROUGH [[clang::fallthrough]] #elif __has_cpp_attribute(gnu::fallthrough) #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] #endif #endif #ifndef CYTHON_FALLTHROUGH #if __has_attribute(fallthrough) #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) #else #define CYTHON_FALLTHROUGH #endif #endif #if defined(__clang__ ) && defined(__apple_build_version__) #if __apple_build_version__ < 7000000 #undef CYTHON_FALLTHROUGH #define CYTHON_FALLTHROUGH #endif #endif #endif #ifndef CYTHON_INLINE #if defined(__clang__) #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) #elif defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) #define Py_OptimizeFlag 0 #endif #define __PYX_BUILD_PY_SSIZE_T "n" #define CYTHON_FORMAT_SSIZE_T "z" #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" #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) #else #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) #endif #define __Pyx_DefaultClassType PyType_Type #endif #ifndef Py_TPFLAGS_CHECKTYPES #define Py_TPFLAGS_CHECKTYPES 0 #endif #ifndef Py_TPFLAGS_HAVE_INDEX #define Py_TPFLAGS_HAVE_INDEX 0 #endif #ifndef Py_TPFLAGS_HAVE_NEWBUFFER #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #ifndef Py_TPFLAGS_HAVE_FINALIZE #define Py_TPFLAGS_HAVE_FINALIZE 0 #endif #ifndef METH_STACKLESS #define METH_STACKLESS 0 #endif #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) #ifndef METH_FASTCALL #define METH_FASTCALL 0x80 #endif typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else #define __Pyx_PyCFunctionFast _PyCFunctionFast #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords #endif #if CYTHON_FAST_PYCCALL #define __Pyx_PyFastCFunction_Check(func)\ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))))) #else #define __Pyx_PyFastCFunction_Check(func) 0 #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) #define PyObject_Malloc(s) PyMem_Malloc(s) #define PyObject_Free(p) PyMem_Free(p) #define PyObject_Realloc(p) PyMem_Realloc(p) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1 #define PyMem_RawMalloc(n) PyMem_Malloc(n) #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n) #define PyMem_RawFree(p) PyMem_Free(p) #endif #if CYTHON_COMPILING_IN_PYSTON #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) #else #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) #endif #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #elif PY_VERSION_HEX >= 0x03060000 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() #elif PY_VERSION_HEX >= 0x03000000 #define __Pyx_PyThreadState_Current PyThreadState_GET() #else #define __Pyx_PyThreadState_Current _PyThreadState_Current #endif #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) #include "pythread.h" #define Py_tss_NEEDS_INIT 0 typedef int Py_tss_t; static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { *key = PyThread_create_key(); return 0; } static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); *key = Py_tss_NEEDS_INIT; return key; } static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { PyObject_Free(key); } static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { return *key != Py_tss_NEEDS_INIT; } static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { PyThread_delete_key(*key); *key = Py_tss_NEEDS_INIT; } static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { return PyThread_set_key_value(*key, value); } static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { return PyThread_get_key_value(*key); } #endif #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) #else #define __Pyx_PyDict_NewPresized(n) PyDict_New() #endif #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION #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 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) #else #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) #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_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) #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) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) #else #define CYTHON_PEP393_ENABLED 0 #define PyUnicode_1BYTE_KIND 1 #define PyUnicode_2BYTE_KIND 2 #define PyUnicode_4BYTE_KIND 4 #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_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) #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])) #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) #endif #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) #else #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) #endif #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) #endif #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) #if 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 && !defined(PyObject_ASCII) #define PyObject_ASCII(o) PyObject_Repr(o) #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 #define PyObject_Unicode PyObject_Str #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_Check(obj) || PyUnicode_Check(obj)) #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) #endif #ifndef PySet_CheckExact #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #if CYTHON_ASSUME_SAFE_MACROS #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) #else #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) #endif #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_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY #ifndef PyUnicode_InternFromString #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) #endif #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 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) #else #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) #endif #if CYTHON_USE_ASYNC_SLOTS #if PY_VERSION_HEX >= 0x030500B1 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) #else #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) #endif #else #define __Pyx_PyType_AsAsync(obj) NULL #endif #ifndef __Pyx_PyAsyncMethodsStruct typedef struct { unaryfunc am_await; unaryfunc am_aiter; unaryfunc am_anext; } __Pyx_PyAsyncMethodsStruct; #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #ifdef NAN #define __PYX_NAN() ((float) NAN) #else static CYTHON_INLINE float __PYX_NAN() { float value; memset(&value, 0xFF, sizeof(value)); return value; } #endif #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) #define __Pyx_truncl trunc #else #define __Pyx_truncl truncl #endif #define __PYX_ERR(f_index, lineno, Ln_error) \ { \ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ } #ifndef __PYX_EXTERN_C #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #endif #define __PYX_HAVE__cytoolz__utils #define __PYX_HAVE_API__cytoolz__utils /* Early includes */ #ifdef _OPENMP #include #endif /* _OPENMP */ #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) #define CYTHON_WITHOUT_ASSERTIONS #endif typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8) #define __PYX_DEFAULT_STRING_ENCODING "" #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize #define __Pyx_uchar_cast(c) ((unsigned char)c) #define __Pyx_long_cast(x) ((long)x) #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ (sizeof(type) < sizeof(Py_ssize_t)) ||\ (sizeof(type) > sizeof(Py_ssize_t) &&\ likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX) &&\ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ v == (type)PY_SSIZE_T_MIN))) ||\ (sizeof(type) == sizeof(Py_ssize_t) &&\ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ v == (type)PY_SSIZE_T_MAX))) ) static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) { return (size_t) i < (size_t) limit; } #if defined (__cplusplus) && __cplusplus >= 201103L #include #define __Pyx_sst_abs(value) std::abs(value) #elif SIZEOF_INT >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) abs(value) #elif SIZEOF_LONG >= SIZEOF_SIZE_T #define __Pyx_sst_abs(value) labs(value) #elif defined (_MSC_VER) #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define __Pyx_sst_abs(value) llabs(value) #elif defined (__GNUC__) #define __Pyx_sst_abs(value) __builtin_llabs(value) #else #define __Pyx_sst_abs(value) ((value<0) ? -value : value) #endif static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); static CYTHON_INLINE const 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_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) 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); } #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_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b); static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); #define __Pyx_PySequence_Tuple(obj)\ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); #if CYTHON_ASSUME_SAFE_MACROS #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 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) #else #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) #endif #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(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*) "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) + 1); 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 CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } static PyObject *__pyx_m = NULL; static PyObject *__pyx_d; static PyObject *__pyx_b; static PyObject *__pyx_cython_runtime = NULL; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static PyObject *__pyx_empty_unicode; 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[] = { "cytoolz/utils.pyx", }; /*--- Type declarations ---*/ /* --- Runtime support code (head) --- */ /* Refnanny.proto */ #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); #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 #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) /* PyObjectGetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); #else #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) #endif /* GetBuiltinName.proto */ static PyObject *__Pyx_GetBuiltinName(PyObject *name); /* RaiseArgTupleInvalid.proto */ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /* RaiseDoubleKeywords.proto */ static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /* ParseKeywords.proto */ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ const char* function_name); /* PyFunctionFastCall.proto */ #if CYTHON_FAST_PYCALL #define __Pyx_PyFunction_FastCall(func, args, nargs)\ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs); #else #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) #endif #define __Pyx_BUILD_ASSERT_EXPR(cond)\ (sizeof(char [1 - 2*!(cond)]) - 1) #ifndef Py_MEMBER_SIZE #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member) #endif static size_t __pyx_pyframe_localsplus_offset = 0; #include "frameobject.h" #define __Pxy_PyFrame_Initialize_Offsets()\ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus))) #define __Pyx_PyFrame_GetLocalsplus(frame)\ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset)) #endif /* PyObjectCall.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); #else #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) #endif /* PyObjectCallMethO.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); #endif /* PyObjectCallNoArg.proto */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); #else #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) #endif /* PyCFunctionFastCall.proto */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); #else #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) #endif /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); /* GetTopmostException.proto */ #if CYTHON_USE_EXC_INFO_STACK static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate); #endif /* PyThreadStateGet.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type #else #define __Pyx_PyThreadState_declare #define __Pyx_PyThreadState_assign #define __Pyx_PyErr_Occurred() PyErr_Occurred() #endif /* SaveResetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); #else #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif /* PyErrExceptionMatches.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err) static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err); #else #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err) #endif /* GetException.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); #endif /* PyDictVersioning.proto */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1) #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\ (version_var) = __PYX_GET_DICT_VERSION(dict);\ (cache_var) = (value); #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\ (VAR) = __pyx_dict_cached_value;\ } else {\ (VAR) = __pyx_dict_cached_value = (LOOKUP);\ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\ }\ } static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj); static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj); static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version); #else #define __PYX_GET_DICT_VERSION(dict) (0) #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var) #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP); #endif /* GetModuleGlobalName.proto */ #if CYTHON_USE_DICT_VERSIONS #define __Pyx_GetModuleGlobalName(var, name) {\ static PY_UINT64_T __pyx_dict_version = 0;\ static PyObject *__pyx_dict_cached_value = NULL;\ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } #define __Pyx_GetModuleGlobalNameUncached(var, name) {\ PY_UINT64_T __pyx_dict_version;\ PyObject *__pyx_dict_cached_value;\ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\ } static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value); #else #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name) #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name) static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name); #endif /* GetItemInt.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 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); /* PyObjectCall2Args.proto */ static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2); /* Import.proto */ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /* ImportFrom.proto */ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /* FetchCommonType.proto */ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); /* CythonFunction.proto */ #define __Pyx_CyFunction_USED 1 #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; #if PY_VERSION_HEX < 0x030500A0 PyObject *func_weakreflist; #endif PyObject *func_dict; PyObject *func_name; PyObject *func_qualname; PyObject *func_doc; PyObject *func_globals; PyObject *func_code; PyObject *func_closure; PyObject *func_classobj; void *defaults; int defaults_pyobjects; int flags; PyObject *defaults_tuple; PyObject *defaults_kwdict; PyObject *(*defaults_getter)(PyObject *); PyObject *func_annotations; } __pyx_CyFunctionObject; static PyTypeObject *__pyx_CyFunctionType = 0; #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType)) #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); /* PyErrFetchRestore.proto */ #if CYTHON_FAST_THREAD_STATE #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) #else #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #endif #else #define __Pyx_PyErr_Clear() PyErr_Clear() #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) #endif /* CLineInTraceback.proto */ #ifdef CYTHON_CLINE_IN_TRACEBACK #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) #else static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); #endif /* CodeObjectCache.proto */ typedef struct { PyCodeObject* code_object; int code_line; } __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); /* AddTraceback.proto */ static void __Pyx_AddTraceback(const char *funcname, int c_line, int py_line, const char *filename); /* CIntToPy.proto */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); /* CIntFromPy.proto */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); /* CIntFromPy.proto */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); /* FastTypeChecks.proto */ #if CYTHON_COMPILING_IN_CPYTHON #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); #else #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) #endif #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) /* CheckBinaryVersion.proto */ static int __Pyx_check_binary_version(void); /* FunctionExport.proto */ static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); /* InitStrings.proto */ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /* Module declarations from 'cytoolz.utils' */ static PyObject *__pyx_f_7cytoolz_5utils_consume(PyObject *, int __pyx_skip_dispatch); /*proto*/ #define __Pyx_MODULE_NAME "cytoolz.utils" extern int __pyx_module_is_main_cytoolz__utils; int __pyx_module_is_main_cytoolz__utils = 0; /* Implementation of 'cytoolz.utils' */ static PyObject *__pyx_builtin_ImportError; static const char __pyx_k_os[] = "os"; static const char __pyx_k_all[] = "__all__"; static const char __pyx_k_err[] = "err"; static const char __pyx_k_seq[] = "seq"; static const char __pyx_k_main[] = "__main__"; static const char __pyx_k_name[] = "__name__"; static const char __pyx_k_path[] = "path"; static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_lamda[] = "lamda"; static const char __pyx_k_split[] = "split"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_path_2[] = "__path__"; static const char __pyx_k_raises[] = "raises"; static const char __pyx_k_consume[] = "consume"; static const char __pyx_k_cytoolz[] = "cytoolz"; static const char __pyx_k_os_path[] = "os.path"; static const char __pyx_k_no_default[] = "no_default"; static const char __pyx_k_ImportError[] = "ImportError"; static const char __pyx_k_no__default[] = "__no__default__"; static const char __pyx_k_toolz_utils[] = "toolz.utils"; static const char __pyx_k_include_dirs[] = "include_dirs"; static const char __pyx_k_cytoolz_utils[] = "cytoolz.utils"; static const char __pyx_k_cytoolz_utils_pyx[] = "cytoolz/utils.pyx"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static PyObject *__pyx_n_s_ImportError; static PyObject *__pyx_n_s_all; static PyObject *__pyx_n_s_cline_in_traceback; static PyObject *__pyx_n_s_consume; static PyObject *__pyx_n_s_cytoolz; static PyObject *__pyx_n_s_cytoolz_utils; static PyObject *__pyx_kp_s_cytoolz_utils_pyx; static PyObject *__pyx_n_s_err; static PyObject *__pyx_n_s_import; static PyObject *__pyx_n_s_include_dirs; static PyObject *__pyx_n_s_lamda; static PyObject *__pyx_n_s_main; static PyObject *__pyx_n_s_name; static PyObject *__pyx_n_s_no__default; static PyObject *__pyx_n_s_no_default; static PyObject *__pyx_n_s_os; static PyObject *__pyx_n_s_os_path; static PyObject *__pyx_n_s_path; static PyObject *__pyx_n_s_path_2; static PyObject *__pyx_n_s_raises; static PyObject *__pyx_n_s_seq; static PyObject *__pyx_n_s_split; static PyObject *__pyx_n_s_test; static PyObject *__pyx_n_s_toolz_utils; static PyObject *__pyx_pf_7cytoolz_5utils_raises(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_err, PyObject *__pyx_v_lamda); /* proto */ static PyObject *__pyx_pf_7cytoolz_5utils_2include_dirs(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_7cytoolz_5utils_4consume(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq); /* proto */ static PyObject *__pyx_tuple_; static PyObject *__pyx_tuple__4; static PyObject *__pyx_codeobj__2; static PyObject *__pyx_codeobj__3; static PyObject *__pyx_codeobj__5; /* Late includes */ /* "cytoolz/utils.pyx":15 * * * def raises(err, lamda): # <<<<<<<<<<<<<< * try: * lamda() */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_5utils_1raises(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_7cytoolz_5utils_raises[] = "raises(err, lamda)"; static PyMethodDef __pyx_mdef_7cytoolz_5utils_1raises = {"raises", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7cytoolz_5utils_1raises, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7cytoolz_5utils_raises}; static PyObject *__pyx_pw_7cytoolz_5utils_1raises(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_err = 0; PyObject *__pyx_v_lamda = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("raises (wrapper)", 0); { static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_err,&__pyx_n_s_lamda,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); CYTHON_FALLTHROUGH; case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } kw_args = PyDict_Size(__pyx_kwds); switch (pos_args) { case 0: if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_err)) != 0)) kw_args--; else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lamda)) != 0)) kw_args--; else { __Pyx_RaiseArgtupleInvalid("raises", 1, 2, 2, 1); __PYX_ERR(0, 15, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "raises") < 0)) __PYX_ERR(0, 15, __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_err = values[0]; __pyx_v_lamda = values[1]; } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("raises", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 15, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("cytoolz.utils.raises", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_7cytoolz_5utils_raises(__pyx_self, __pyx_v_err, __pyx_v_lamda); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_5utils_raises(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_err, PyObject *__pyx_v_lamda) { 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; __Pyx_RefNannySetupContext("raises", 0); /* "cytoolz/utils.pyx":16 * * def raises(err, lamda): * try: # <<<<<<<<<<<<<< * lamda() * return False */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __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:*/ { /* "cytoolz/utils.pyx":17 * def raises(err, lamda): * try: * lamda() # <<<<<<<<<<<<<< * return False * except err: */ __Pyx_INCREF(__pyx_v_lamda); __pyx_t_5 = __pyx_v_lamda; __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) { __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); } } __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 17, __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; /* "cytoolz/utils.pyx":18 * try: * lamda() * return False # <<<<<<<<<<<<<< * except err: * return True */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_False); __pyx_r = Py_False; goto __pyx_L7_try_return; /* "cytoolz/utils.pyx":16 * * def raises(err, lamda): * try: # <<<<<<<<<<<<<< * lamda() * return False */ } __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; /* "cytoolz/utils.pyx":19 * lamda() * return False * except err: # <<<<<<<<<<<<<< * return True * */ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_v_err); if (__pyx_t_7) { __Pyx_AddTraceback("cytoolz.utils.raises", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 19, __pyx_L5_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_6); /* "cytoolz/utils.pyx":20 * return False * except err: * return True # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(Py_True); __pyx_r = Py_True; __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; } goto __pyx_L5_except_error; __pyx_L5_except_error:; /* "cytoolz/utils.pyx":16 * * def raises(err, lamda): * try: # <<<<<<<<<<<<<< * lamda() * return False */ __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; } /* "cytoolz/utils.pyx":15 * * * def raises(err, lamda): # <<<<<<<<<<<<<< * try: * lamda() */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("cytoolz.utils.raises", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/utils.pyx":23 * * * def include_dirs(): # <<<<<<<<<<<<<< * """ Return a list of directories containing the *.pxd files for ``cytoolz`` * */ /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_5utils_3include_dirs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_7cytoolz_5utils_2include_dirs[] = "include_dirs()\n Return a list of directories containing the *.pxd files for ``cytoolz``\n\n Use this to include ``cytoolz`` in your own Cython project, which allows\n fast C bindinds to be imported such as ``from cytoolz cimport get``.\n\n Below is a minimal \"setup.py\" file using ``include_dirs``:\n\n from distutils.core import setup\n from distutils.extension import Extension\n from Cython.Distutils import build_ext\n\n import cytoolz.utils\n\n ext_modules=[\n Extension(\"mymodule\",\n [\"mymodule.pyx\"],\n include_dirs=cytoolz.utils.include_dirs()\n )\n ]\n\n setup(\n name = \"mymodule\",\n cmdclass = {\"build_ext\": build_ext},\n ext_modules = ext_modules\n )\n "; static PyMethodDef __pyx_mdef_7cytoolz_5utils_3include_dirs = {"include_dirs", (PyCFunction)__pyx_pw_7cytoolz_5utils_3include_dirs, METH_NOARGS, __pyx_doc_7cytoolz_5utils_2include_dirs}; static PyObject *__pyx_pw_7cytoolz_5utils_3include_dirs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("include_dirs (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_5utils_2include_dirs(__pyx_self); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_5utils_2include_dirs(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; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("include_dirs", 0); /* "cytoolz/utils.pyx":50 * ) * """ * return os.path.split(cytoolz.__path__[0]) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __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_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_cytoolz); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __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, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); } } __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __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; /* "cytoolz/utils.pyx":23 * * * def include_dirs(): # <<<<<<<<<<<<<< * """ Return a list of directories containing the *.pxd files for ``cytoolz`` * */ /* 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("cytoolz.utils.include_dirs", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "cytoolz/utils.pyx":53 * * * cpdef object consume(object seq): # <<<<<<<<<<<<<< * """ * Efficiently consume an iterable """ */ static PyObject *__pyx_pw_7cytoolz_5utils_5consume(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/ static PyObject *__pyx_f_7cytoolz_5utils_consume(PyObject *__pyx_v_seq, CYTHON_UNUSED int __pyx_skip_dispatch) { CYTHON_UNUSED PyObject *__pyx_v__ = NULL; 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; __Pyx_RefNannySetupContext("consume", 0); /* "cytoolz/utils.pyx":56 * """ * Efficiently consume an iterable """ * for _ in seq: # <<<<<<<<<<<<<< * pass */ if (likely(PyList_CheckExact(__pyx_v_seq)) || PyTuple_CheckExact(__pyx_v_seq)) { __pyx_t_1 = __pyx_v_seq; __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_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 56, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS __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_ERR(0, 56, __pyx_L1_error) #else __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); else __PYX_ERR(0, 56, __pyx_L1_error) } break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v__, __pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/utils.pyx":53 * * * cpdef object consume(object seq): # <<<<<<<<<<<<<< * """ * Efficiently consume an iterable """ */ /* 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_AddTraceback("cytoolz.utils.consume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XDECREF(__pyx_v__); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* Python wrapper */ static PyObject *__pyx_pw_7cytoolz_5utils_5consume(PyObject *__pyx_self, PyObject *__pyx_v_seq); /*proto*/ static char __pyx_doc_7cytoolz_5utils_4consume[] = "consume(seq)\n\n Efficiently consume an iterable "; static PyMethodDef __pyx_mdef_7cytoolz_5utils_5consume = {"consume", (PyCFunction)__pyx_pw_7cytoolz_5utils_5consume, METH_O, __pyx_doc_7cytoolz_5utils_4consume}; static PyObject *__pyx_pw_7cytoolz_5utils_5consume(PyObject *__pyx_self, PyObject *__pyx_v_seq) { PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("consume (wrapper)", 0); __pyx_r = __pyx_pf_7cytoolz_5utils_4consume(__pyx_self, ((PyObject *)__pyx_v_seq)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_pf_7cytoolz_5utils_4consume(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_seq) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("consume", 0); __Pyx_XDECREF(__pyx_r); __pyx_t_1 = __pyx_f_7cytoolz_5utils_consume(__pyx_v_seq, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_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("cytoolz.utils.consume", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 #if CYTHON_PEP489_MULTI_PHASE_INIT static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ static int __pyx_pymod_exec_utils(PyObject* module); /*proto*/ static PyModuleDef_Slot __pyx_moduledef_slots[] = { {Py_mod_create, (void*)__pyx_pymod_create}, {Py_mod_exec, (void*)__pyx_pymod_exec_utils}, {0, NULL} }; #endif static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, "utils", 0, /* m_doc */ #if CYTHON_PEP489_MULTI_PHASE_INIT 0, /* m_size */ #else -1, /* m_size */ #endif __pyx_methods /* m_methods */, #if CYTHON_PEP489_MULTI_PHASE_INIT __pyx_moduledef_slots, /* m_slots */ #else NULL, /* m_reload */ #endif NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif #ifndef CYTHON_SMALL_CODE #if defined(__clang__) #define CYTHON_SMALL_CODE #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) #define CYTHON_SMALL_CODE __attribute__((cold)) #else #define CYTHON_SMALL_CODE #endif #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1}, {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1}, {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, {&__pyx_n_s_consume, __pyx_k_consume, sizeof(__pyx_k_consume), 0, 0, 1, 1}, {&__pyx_n_s_cytoolz, __pyx_k_cytoolz, sizeof(__pyx_k_cytoolz), 0, 0, 1, 1}, {&__pyx_n_s_cytoolz_utils, __pyx_k_cytoolz_utils, sizeof(__pyx_k_cytoolz_utils), 0, 0, 1, 1}, {&__pyx_kp_s_cytoolz_utils_pyx, __pyx_k_cytoolz_utils_pyx, sizeof(__pyx_k_cytoolz_utils_pyx), 0, 0, 1, 0}, {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1}, {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, {&__pyx_n_s_include_dirs, __pyx_k_include_dirs, sizeof(__pyx_k_include_dirs), 0, 0, 1, 1}, {&__pyx_n_s_lamda, __pyx_k_lamda, sizeof(__pyx_k_lamda), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_no__default, __pyx_k_no__default, sizeof(__pyx_k_no__default), 0, 0, 1, 1}, {&__pyx_n_s_no_default, __pyx_k_no_default, sizeof(__pyx_k_no_default), 0, 0, 1, 1}, {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, {&__pyx_n_s_os_path, __pyx_k_os_path, sizeof(__pyx_k_os_path), 0, 0, 1, 1}, {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1}, {&__pyx_n_s_path_2, __pyx_k_path_2, sizeof(__pyx_k_path_2), 0, 0, 1, 1}, {&__pyx_n_s_raises, __pyx_k_raises, sizeof(__pyx_k_raises), 0, 0, 1, 1}, {&__pyx_n_s_seq, __pyx_k_seq, sizeof(__pyx_k_seq), 0, 0, 1, 1}, {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1}, {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, {&__pyx_n_s_toolz_utils, __pyx_k_toolz_utils, sizeof(__pyx_k_toolz_utils), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 11, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; } static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); /* "cytoolz/utils.pyx":15 * * * def raises(err, lamda): # <<<<<<<<<<<<<< * try: * lamda() */ __pyx_tuple_ = PyTuple_Pack(2, __pyx_n_s_err, __pyx_n_s_lamda); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_utils_pyx, __pyx_n_s_raises, 15, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 15, __pyx_L1_error) /* "cytoolz/utils.pyx":23 * * * def include_dirs(): # <<<<<<<<<<<<<< * """ Return a list of directories containing the *.pxd files for ``cytoolz`` * */ __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_utils_pyx, __pyx_n_s_include_dirs, 23, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 23, __pyx_L1_error) /* "cytoolz/utils.pyx":53 * * * cpdef object consume(object seq): # <<<<<<<<<<<<<< * """ * Efficiently consume an iterable """ */ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_n_s_seq); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__4); __Pyx_GIVEREF(__pyx_tuple__4); __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_cytoolz_utils_pyx, __pyx_n_s_consume, 53, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); return 0; __pyx_L1_error:; return -1; } static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/ static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/ static int __Pyx_modinit_global_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); /*--- Global init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); /*--- Variable export code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_export_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); /*--- Function export code ---*/ if (__Pyx_ExportFunction("consume", (void (*)(void))__pyx_f_7cytoolz_5utils_consume, "PyObject *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_type_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); /*--- Type import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_variable_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); /*--- Variable import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } static int __Pyx_modinit_function_import_code(void) { __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); /*--- Function import code ---*/ __Pyx_RefNannyFinishContext(); return 0; } #if PY_MAJOR_VERSION < 3 #ifdef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC void #else #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #endif #else #ifdef CYTHON_NO_PYINIT_EXPORT #define __Pyx_PyMODINIT_FUNC PyObject * #else #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC #endif #endif #if PY_MAJOR_VERSION < 3 __Pyx_PyMODINIT_FUNC initutils(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC initutils(void) #else __Pyx_PyMODINIT_FUNC PyInit_utils(void) CYTHON_SMALL_CODE; /*proto*/ __Pyx_PyMODINIT_FUNC PyInit_utils(void) #if CYTHON_PEP489_MULTI_PHASE_INIT { return PyModuleDef_Init(&__pyx_moduledef); } static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) { #if PY_VERSION_HEX >= 0x030700A1 static PY_INT64_T main_interpreter_id = -1; PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp); if (main_interpreter_id == -1) { main_interpreter_id = current_id; return (unlikely(current_id == -1)) ? -1 : 0; } else if (unlikely(main_interpreter_id != current_id)) #else static PyInterpreterState *main_interpreter = NULL; PyInterpreterState *current_interpreter = PyThreadState_Get()->interp; if (!main_interpreter) { main_interpreter = current_interpreter; } else if (unlikely(main_interpreter != current_interpreter)) #endif { PyErr_SetString( PyExc_ImportError, "Interpreter change detected - this module can only be loaded into one interpreter per process."); return -1; } return 0; } static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) { PyObject *value = PyObject_GetAttrString(spec, from_name); int result = 0; if (likely(value)) { if (allow_none || value != Py_None) { result = PyDict_SetItemString(moddict, to_name, value); } Py_DECREF(value); } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { PyErr_Clear(); } else { result = -1; } return result; } static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { PyObject *module = NULL, *moddict, *modname; if (__Pyx_check_single_interpreter()) return NULL; if (__pyx_m) return __Pyx_NewRef(__pyx_m); modname = PyObject_GetAttrString(spec, "name"); if (unlikely(!modname)) goto bad; module = PyModule_NewObject(modname); Py_DECREF(modname); if (unlikely(!module)) goto bad; moddict = PyModule_GetDict(module); if (unlikely(!moddict)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad; if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad; return module; bad: Py_XDECREF(module); return NULL; } static CYTHON_SMALL_CODE int __pyx_pymod_exec_utils(PyObject *__pyx_pyinit_module) #endif #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; __Pyx_RefNannyDeclarations #if CYTHON_PEP489_MULTI_PHASE_INIT if (__pyx_m) { if (__pyx_m == __pyx_pyinit_module) return 0; PyErr_SetString(PyExc_RuntimeError, "Module 'utils' has already been imported. Re-initialisation is not supported."); return -1; } #elif PY_MAJOR_VERSION >= 3 if (__pyx_m) return __Pyx_NewRef(__pyx_m); #endif #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("__Pyx_PyMODINIT_FUNC PyInit_utils(void)", 0); if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pxy_PyFrame_Initialize_Offsets __Pxy_PyFrame_Initialize_Offsets(); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) #ifdef __Pyx_CyFunction_USED if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_FusedFunction_USED if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Coroutine_USED if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_Generator_USED if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_AsyncGen_USED if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif #ifdef __Pyx_StopAsyncIteration_USED if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __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 CYTHON_PEP489_MULTI_PHASE_INIT __pyx_m = __pyx_pyinit_module; Py_INCREF(__pyx_m); #else #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4("utils", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) #endif __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_d); __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_b); __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) Py_INCREF(__pyx_cython_runtime); if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); /*--- Initialize various global constants etc. ---*/ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __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_ERR(0, 1, __pyx_L1_error) #endif if (__pyx_module_is_main_cytoolz__utils) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) if (!PyDict_GetItemString(modules, "cytoolz.utils")) { if (unlikely(PyDict_SetItemString(modules, "cytoolz.utils", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif /*--- Builtin init code ---*/ if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error; /*--- Constants init code ---*/ if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error; /*--- Global type/function init code ---*/ (void)__Pyx_modinit_global_init_code(); (void)__Pyx_modinit_variable_export_code(); if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error; (void)__Pyx_modinit_type_init_code(); (void)__Pyx_modinit_type_import_code(); (void)__Pyx_modinit_variable_import_code(); (void)__Pyx_modinit_function_import_code(); /*--- Execution code ---*/ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif /* "cytoolz/utils.pyx":1 * import os.path # <<<<<<<<<<<<<< * import cytoolz * */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_os_path, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/utils.pyx":2 * import os.path * import cytoolz # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_Import(__pyx_n_s_cytoolz, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_cytoolz, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/utils.pyx":5 * * * __all__ = ['raises', 'no_default', 'include_dirs', 'consume'] # <<<<<<<<<<<<<< * * */ __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_raises); __Pyx_GIVEREF(__pyx_n_s_raises); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_raises); __Pyx_INCREF(__pyx_n_s_no_default); __Pyx_GIVEREF(__pyx_n_s_no_default); PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_no_default); __Pyx_INCREF(__pyx_n_s_include_dirs); __Pyx_GIVEREF(__pyx_n_s_include_dirs); PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_include_dirs); __Pyx_INCREF(__pyx_n_s_consume); __Pyx_GIVEREF(__pyx_n_s_consume); PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_consume); if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "cytoolz/utils.pyx":8 * * * try: # <<<<<<<<<<<<<< * # Attempt to get the no_default sentinel object from toolz * from toolz.utils import no_default */ { __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __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:*/ { /* "cytoolz/utils.pyx":10 * try: * # Attempt to get the no_default sentinel object from toolz * from toolz.utils import no_default # <<<<<<<<<<<<<< * except ImportError: * no_default = '__no__default__' */ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_n_s_no_default); __Pyx_GIVEREF(__pyx_n_s_no_default); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_no_default); __pyx_t_5 = __Pyx_Import(__pyx_n_s_toolz_utils, __pyx_t_1, -1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 10, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_no_default); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L2_error) __Pyx_GOTREF(__pyx_t_1); if (PyDict_SetItem(__pyx_d, __pyx_n_s_no_default, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L2_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "cytoolz/utils.pyx":8 * * * try: # <<<<<<<<<<<<<< * # Attempt to get the no_default sentinel object from toolz * from toolz.utils import no_default */ } __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_L7_try_end; __pyx_L2_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; /* "cytoolz/utils.pyx":11 * # Attempt to get the no_default sentinel object from toolz * from toolz.utils import no_default * except ImportError: # <<<<<<<<<<<<<< * no_default = '__no__default__' * */ __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError); if (__pyx_t_6) { __Pyx_AddTraceback("cytoolz.utils", __pyx_clineno, __pyx_lineno, __pyx_filename); if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_7) < 0) __PYX_ERR(0, 11, __pyx_L4_except_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_7); /* "cytoolz/utils.pyx":12 * from toolz.utils import no_default * except ImportError: * no_default = '__no__default__' # <<<<<<<<<<<<<< * * */ if (PyDict_SetItem(__pyx_d, __pyx_n_s_no_default, __pyx_n_s_no__default) < 0) __PYX_ERR(0, 12, __pyx_L4_except_error) __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; goto __pyx_L3_exception_handled; } goto __pyx_L4_except_error; __pyx_L4_except_error:; /* "cytoolz/utils.pyx":8 * * * try: # <<<<<<<<<<<<<< * # Attempt to get the no_default sentinel object from toolz * from toolz.utils import no_default */ __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_L3_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_L7_try_end:; } /* "cytoolz/utils.pyx":15 * * * def raises(err, lamda): # <<<<<<<<<<<<<< * try: * lamda() */ __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_5utils_1raises, 0, __pyx_n_s_raises, NULL, __pyx_n_s_cytoolz_utils, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_raises, __pyx_t_7) < 0) __PYX_ERR(0, 15, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "cytoolz/utils.pyx":23 * * * def include_dirs(): # <<<<<<<<<<<<<< * """ Return a list of directories containing the *.pxd files for ``cytoolz`` * */ __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_5utils_3include_dirs, 0, __pyx_n_s_include_dirs, NULL, __pyx_n_s_cytoolz_utils, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_include_dirs, __pyx_t_7) < 0) __PYX_ERR(0, 23, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "cytoolz/utils.pyx":53 * * * cpdef object consume(object seq): # <<<<<<<<<<<<<< * """ * Efficiently consume an iterable """ */ __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7cytoolz_5utils_5consume, 0, __pyx_n_s_consume, NULL, __pyx_n_s_cytoolz_utils, __pyx_d, ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_consume, __pyx_t_7) < 0) __PYX_ERR(0, 53, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "cytoolz/utils.pyx":1 * import os.path # <<<<<<<<<<<<<< * import cytoolz * */ __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /*--- Wrapped vars code ---*/ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); if (__pyx_m) { if (__pyx_d) { __Pyx_AddTraceback("init cytoolz.utils", __pyx_clineno, __pyx_lineno, __pyx_filename); } Py_CLEAR(__pyx_m); } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init cytoolz.utils"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if CYTHON_PEP489_MULTI_PHASE_INIT return (__pyx_m != NULL) ? 0 : -1; #elif PY_MAJOR_VERSION >= 3 return __pyx_m; #else return; #endif } /* --- Runtime support code --- */ /* Refnanny */ #if CYTHON_REFNANNY static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule(modname); if (!m) goto end; p = PyObject_GetAttrString(m, "RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #endif /* PyObjectGetAttrStr */ #if CYTHON_USE_TYPE_SLOTS 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); } #endif /* GetBuiltinName */ 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; } /* RaiseArgTupleInvalid */ 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); } /* RaiseDoubleKeywords */ 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 } /* ParseKeywords */ 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; } /* PyFunctionFastCall */ #if CYTHON_FAST_PYCALL static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, PyObject *globals) { PyFrameObject *f; PyThreadState *tstate = __Pyx_PyThreadState_Current; PyObject **fastlocals; Py_ssize_t i; PyObject *result; assert(globals != NULL); /* XXX Perhaps we should create a specialized PyFrame_New() that doesn't take locals, but does take builtins without sanity checking them. */ assert(tstate != NULL); f = PyFrame_New(tstate, co, globals, NULL); if (f == NULL) { return NULL; } fastlocals = __Pyx_PyFrame_GetLocalsplus(f); for (i = 0; i < na; i++) { Py_INCREF(*args); fastlocals[i] = *args++; } result = PyEval_EvalFrameEx(f,0); ++tstate->recursion_depth; Py_DECREF(f); --tstate->recursion_depth; return result; } #if 1 || PY_VERSION_HEX < 0x030600B1 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) { PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); PyObject *globals = PyFunction_GET_GLOBALS(func); PyObject *argdefs = PyFunction_GET_DEFAULTS(func); PyObject *closure; #if PY_MAJOR_VERSION >= 3 PyObject *kwdefs; #endif PyObject *kwtuple, **k; PyObject **d; Py_ssize_t nd; Py_ssize_t nk; PyObject *result; assert(kwargs == NULL || PyDict_Check(kwargs)); nk = kwargs ? PyDict_Size(kwargs) : 0; if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { return NULL; } if ( #if PY_MAJOR_VERSION >= 3 co->co_kwonlyargcount == 0 && #endif likely(kwargs == NULL || nk == 0) && co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { if (argdefs == NULL && co->co_argcount == nargs) { result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); goto done; } else if (nargs == 0 && argdefs != NULL && co->co_argcount == Py_SIZE(argdefs)) { /* function called with no arguments, but all parameters have a default value: use default values as arguments .*/ args = &PyTuple_GET_ITEM(argdefs, 0); result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); goto done; } } if (kwargs != NULL) { Py_ssize_t pos, i; kwtuple = PyTuple_New(2 * nk); if (kwtuple == NULL) { result = NULL; goto done; } k = &PyTuple_GET_ITEM(kwtuple, 0); pos = i = 0; while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { Py_INCREF(k[i]); Py_INCREF(k[i+1]); i += 2; } nk = i / 2; } else { kwtuple = NULL; k = NULL; } closure = PyFunction_GET_CLOSURE(func); #if PY_MAJOR_VERSION >= 3 kwdefs = PyFunction_GET_KW_DEFAULTS(func); #endif if (argdefs != NULL) { d = &PyTuple_GET_ITEM(argdefs, 0); nd = Py_SIZE(argdefs); } else { d = NULL; nd = 0; } #if PY_MAJOR_VERSION >= 3 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, kwdefs, closure); #else result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, args, (int)nargs, k, (int)nk, d, (int)nd, closure); #endif Py_XDECREF(kwtuple); done: Py_LeaveRecursiveCall(); return result; } #endif #endif /* PyObjectCall */ #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 (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = (*call)(func, arg, kw); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallMethO */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { PyObject *self, *result; PyCFunction cfunc; cfunc = PyCFunction_GET_FUNCTION(func); self = PyCFunction_GET_SELF(func); if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) return NULL; result = cfunc(self, arg); Py_LeaveRecursiveCall(); if (unlikely(!result) && unlikely(!PyErr_Occurred())) { PyErr_SetString( PyExc_SystemError, "NULL result without error in PyObject_Call"); } return result; } #endif /* PyObjectCallNoArg */ #if CYTHON_COMPILING_IN_CPYTHON static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, NULL, 0); } #endif #ifdef __Pyx_CyFunction_USED if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func))) #else if (likely(PyCFunction_Check(func))) #endif { if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { return __Pyx_PyObject_CallMethO(func, NULL); } } return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); } #endif /* PyCFunctionFastCall */ #if CYTHON_FAST_PYCCALL static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { PyCFunctionObject *func = (PyCFunctionObject*)func_obj; PyCFunction meth = PyCFunction_GET_FUNCTION(func); PyObject *self = PyCFunction_GET_SELF(func); int flags = PyCFunction_GET_FLAGS(func); assert(PyCFunction_Check(func)); assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS))); assert(nargs >= 0); assert(nargs == 0 || args != NULL); /* _PyCFunction_FastCallDict() must not be called with an exception set, because it may clear it (directly or indirectly) and so the caller loses its exception */ assert(!PyErr_Occurred()); if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL); } else { return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs); } } #endif /* PyObjectCallOneArg */ #if CYTHON_COMPILING_IN_CPYTHON static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_New(1); if (unlikely(!args)) return NULL; Py_INCREF(arg); PyTuple_SET_ITEM(args, 0, arg); result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { #if CYTHON_FAST_PYCALL if (PyFunction_Check(func)) { return __Pyx_PyFunction_FastCall(func, &arg, 1); } #endif if (likely(PyCFunction_Check(func))) { if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { return __Pyx_PyObject_CallMethO(func, arg); #if CYTHON_FAST_PYCCALL } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { return __Pyx_PyCFunction_FastCall(func, &arg, 1); #endif } } return __Pyx__PyObject_CallOneArg(func, arg); } #else static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { PyObject *result; PyObject *args = PyTuple_Pack(1, arg); if (unlikely(!args)) return NULL; result = __Pyx_PyObject_Call(func, args, NULL); Py_DECREF(args); return result; } #endif /* GetTopmostException */ #if CYTHON_USE_EXC_INFO_STACK static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate) { _PyErr_StackItem *exc_info = tstate->exc_info; while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) && exc_info->previous_item != NULL) { exc_info = exc_info->previous_item; } return exc_info; } #endif /* SaveResetException */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate); *type = exc_info->exc_type; *value = exc_info->exc_value; *tb = exc_info->exc_traceback; #else *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; #endif Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); } static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; #if CYTHON_USE_EXC_INFO_STACK _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = type; exc_info->exc_value = value; exc_info->exc_traceback = tb; #else 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; #endif Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } #endif /* PyErrExceptionMatches */ #if CYTHON_FAST_THREAD_STATE static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; icurexc_type; if (exc_type == err) return 1; if (unlikely(!exc_type)) return 0; if (unlikely(PyTuple_Check(err))) return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err); return __Pyx_PyErr_GivenExceptionMatches(exc_type, err); } #endif /* GetException */ #if CYTHON_FAST_THREAD_STATE static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) #else static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) #endif { PyObject *local_type, *local_value, *local_tb; #if CYTHON_FAST_THREAD_STATE PyObject *tmp_type, *tmp_value, *tmp_tb; 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_FAST_THREAD_STATE 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_FAST_THREAD_STATE #if CYTHON_USE_EXC_INFO_STACK { _PyErr_StackItem *exc_info = tstate->exc_info; tmp_type = exc_info->exc_type; tmp_value = exc_info->exc_value; tmp_tb = exc_info->exc_traceback; exc_info->exc_type = local_type; exc_info->exc_value = local_value; exc_info->exc_traceback = local_tb; } #else 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; #endif 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; } /* PyDictVersioning */ #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) { PyObject *dict = Py_TYPE(obj)->tp_dict; return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0; } static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) { PyObject **dictptr = NULL; Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset; if (offset) { #if CYTHON_COMPILING_IN_CPYTHON dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj); #else dictptr = _PyObject_GetDictPtr(obj); #endif } return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0; } static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) { PyObject *dict = Py_TYPE(obj)->tp_dict; if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict))) return 0; return obj_dict_version == __Pyx_get_object_dict_version(obj); } #endif /* GetModuleGlobalName */ #if CYTHON_USE_DICT_VERSIONS static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value) #else static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name) #endif { PyObject *result; #if !CYTHON_AVOID_BORROWED_REFS #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } else if (unlikely(PyErr_Occurred())) { return NULL; } #else result = PyDict_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } #endif #else result = PyObject_GetItem(__pyx_d, name); __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version) if (likely(result)) { return __Pyx_NewRef(result); } PyErr_Clear(); #endif return __Pyx_GetBuiltinName(name); } /* GetItemInt */ static 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, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyList_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, wrapped_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, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS Py_ssize_t wrapped_i = i; if (wraparound & unlikely(i < 0)) { wrapped_i += PyTuple_GET_SIZE(o); } if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, wrapped_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, CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) { #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS if (is_list || PyList_CheckExact(o)) { Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); if ((!boundscheck) || (likely(__Pyx_is_valid_index(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(__Pyx_is_valid_index(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)) return NULL; PyErr_Clear(); } } 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)); } /* PyObjectCall2Args */ static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) { PyObject *args, *result = NULL; #if CYTHON_FAST_PYCALL if (PyFunction_Check(function)) { PyObject *args[2] = {arg1, arg2}; return __Pyx_PyFunction_FastCall(function, args, 2); } #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(function)) { PyObject *args[2] = {arg1, arg2}; return __Pyx_PyCFunction_FastCall(function, args, 2); } #endif args = PyTuple_New(2); if (unlikely(!args)) goto done; Py_INCREF(arg1); PyTuple_SET_ITEM(args, 0, arg1); Py_INCREF(arg2); PyTuple_SET_ITEM(args, 1, arg2); Py_INCREF(function); result = __Pyx_PyObject_Call(function, args, NULL); Py_DECREF(args); Py_DECREF(function); done: return result; } /* Import */ 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_MAJOR_VERSION < 3 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_MAJOR_VERSION >= 3 if (level == -1) { if (strchr(__Pyx_MODULE_NAME, '.')) { module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, 1); if (!module) { if (!PyErr_ExceptionMatches(PyExc_ImportError)) goto bad; PyErr_Clear(); } } level = 0; } #endif if (!module) { #if PY_MAJOR_VERSION < 3 PyObject *py_level = PyInt_FromLong(level); if (!py_level) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, py_level, (PyObject *)NULL); Py_DECREF(py_level); #else module = PyImport_ImportModuleLevelObject( name, global_dict, empty_dict, list, level); #endif } } bad: #if PY_MAJOR_VERSION < 3 Py_XDECREF(py_import); #endif Py_XDECREF(empty_list); Py_XDECREF(empty_dict); return module; } /* ImportFrom */ 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; } /* FetchCommonType */ 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; } /* CythonFunction */ #include 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, CYTHON_UNUSED void *context) { PyObject *tmp = op->func_doc; if (value == NULL) { value = Py_None; } Py_INCREF(value); op->func_doc = value; Py_XDECREF(tmp); return 0; } static PyObject * __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { Py_INCREF(op->func_qualname); return op->func_qualname; } static int __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { Py_INCREF(op->func_globals); return op->func_globals; } static PyObject * __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { Py_INCREF(Py_None); return Py_None; } static PyObject * __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) { PyObject* result = (op->func_code) ? op->func_code : Py_None; Py_INCREF(result); return result; } static int __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { int result = 0; PyObject *res = op->defaults_getter((PyObject *) op); if (unlikely(!res)) return -1; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS 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); #else op->defaults_tuple = PySequence_ITEM(res, 0); if (unlikely(!op->defaults_tuple)) result = -1; else { op->defaults_kwdict = PySequence_ITEM(res, 1); if (unlikely(!op->defaults_kwdict)) result = -1; } #endif Py_DECREF(res); return result; } static int __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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, CYTHON_UNUSED void *context) { 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} }; static PyMemberDef __pyx_CyFunction_members[] = { {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, 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[] = { {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, {0, 0, 0, 0} }; #if PY_VERSION_HEX < 0x030500A0 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist) #else #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist) #endif 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; __Pyx_CyFunction_weakreflist(op) = 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]); PyObject_Free(m->defaults); m->defaults = NULL; } return 0; } static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m) { if (__Pyx_CyFunction_weakreflist(m) != NULL) PyObject_ClearWeakRefs((PyObject *) m); __Pyx_CyFunction_clear(m); PyObject_GC_Del(m); } static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) { PyObject_GC_UnTrack(m); __Pyx__CyFunction_dealloc(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 __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); } if (obj == Py_None) obj = NULL; return __Pyx_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 } static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) { PyCFunctionObject* f = (PyCFunctionObject*)func; PyCFunction meth = f->m_ml->ml_meth; Py_ssize_t size; switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) { case METH_VARARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) return (*meth)(self, arg); break; case METH_VARARGS | METH_KEYWORDS: return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw); case METH_NOARGS: if (likely(kw == NULL || PyDict_Size(kw) == 0)) { size = PyTuple_GET_SIZE(arg); if (likely(size == 0)) return (*meth)(self, NULL); PyErr_Format(PyExc_TypeError, "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d 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 (likely(size == 1)) { PyObject *result, *arg0; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS arg0 = PyTuple_GET_ITEM(arg, 0); #else arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL; #endif result = (*meth)(self, arg0); #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS) Py_DECREF(arg0); #endif return result; } PyErr_Format(PyExc_TypeError, "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d 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; } static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw); } static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) { PyObject *result; __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func; if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) { Py_ssize_t argc; PyObject *new_args; PyObject *self; argc = PyTuple_GET_SIZE(args); new_args = PyTuple_GetSlice(args, 1, argc); if (unlikely(!new_args)) return NULL; self = PyTuple_GetItem(args, 0); if (unlikely(!self)) { Py_DECREF(new_args); return NULL; } result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw); Py_DECREF(new_args); } else { result = __Pyx_CyFunction_Call(func, args, kw); } return result; } static PyTypeObject __pyx_CyFunctionType_type = { PyVarObject_HEAD_INIT(0, 0) "cython_function_or_method", sizeof(__pyx_CyFunctionObject), 0, (destructor) __Pyx_CyFunction_dealloc, 0, 0, 0, #if PY_MAJOR_VERSION < 3 0, #else 0, #endif (reprfunc) __Pyx_CyFunction_repr, 0, 0, 0, 0, __Pyx_CyFunction_CallAsMethod, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, 0, (traverseproc) __Pyx_CyFunction_traverse, (inquiry) __Pyx_CyFunction_clear, 0, #if PY_VERSION_HEX < 0x030500A0 offsetof(__pyx_CyFunctionObject, func_weakreflist), #else offsetof(PyCFunctionObject, m_weakreflist), #endif 0, 0, __pyx_CyFunction_methods, __pyx_CyFunction_members, __pyx_CyFunction_getsets, 0, 0, __Pyx_CyFunction_descr_get, 0, offsetof(__pyx_CyFunctionObject, func_dict), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #if PY_VERSION_HEX >= 0x030400a1 0, #endif #if PY_VERSION_HEX >= 0x030800b1 0, #endif #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000 0, #endif }; static int __pyx_CyFunction_init(void) { __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); if (unlikely(__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 = PyObject_Malloc(size); if (unlikely(!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); } /* PyErrFetchRestore */ #if CYTHON_FAST_THREAD_STATE static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; 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); } static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; } #endif /* CLineInTraceback */ #ifndef CYTHON_CLINE_IN_TRACEBACK static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) { PyObject *use_cline; PyObject *ptype, *pvalue, *ptraceback; #if CYTHON_COMPILING_IN_CPYTHON PyObject **cython_runtime_dict; #endif if (unlikely(!__pyx_cython_runtime)) { return c_line; } __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); #if CYTHON_COMPILING_IN_CPYTHON cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); if (likely(cython_runtime_dict)) { __PYX_PY_DICT_LOOKUP_IF_MODIFIED( use_cline, *cython_runtime_dict, __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback)) } else #endif { PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); if (use_cline_obj) { use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; Py_DECREF(use_cline_obj); } else { PyErr_Clear(); use_cline = NULL; } } if (!use_cline) { c_line = 0; PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); } else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) { c_line = 0; } __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); return c_line; } #endif /* CodeObjectCache */ 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 - start) / 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); } /* AddTraceback */ #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, 0, 0, 0, 0, __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, __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; PyFrameObject *py_frame = 0; PyThreadState *tstate = __Pyx_PyThreadState_Current; if (c_line) { c_line = __Pyx_CLineForTraceback(tstate, c_line); } 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_frame = PyFrame_New( tstate, /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ __pyx_d, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; __Pyx_PyFrame_SetLineNumber(py_frame, py_line); PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_code); Py_XDECREF(py_frame); } /* CIntToPy */ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 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); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); #endif } } else { if (sizeof(long) <= sizeof(long)) { return PyInt_FromLong((long) value); #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { return PyLong_FromLongLong((PY_LONG_LONG) value); #endif } } { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&value; return _PyLong_FromByteArray(bytes, sizeof(long), little, !is_unsigned); } } /* CIntFromPyVerify */ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ {\ func_type value = func_value;\ if (sizeof(target_type) < sizeof(func_type)) {\ if (unlikely(value != (func_type) (target_type) value)) {\ func_type zero = 0;\ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ return (target_type) -1;\ if (is_unsigned && unlikely(value < zero))\ goto raise_neg_overflow;\ else\ goto raise_overflow;\ }\ }\ return (target_type) value;\ } /* CIntFromPy */ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 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(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (long) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (long) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(long) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (long) 0; case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) case -2: if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 2: if (8 * sizeof(long) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -3: if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 3: if (8 * sizeof(long) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case -4: if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; case 4: if (8 * sizeof(long) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); } } break; } #endif if (sizeof(long) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #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_IntOrLong(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_IntOrLong(x); if (!tmp) return (long) -1; val = __Pyx_PyInt_As_long(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to long"); return (long) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long) -1; } /* CIntFromPy */ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 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(x)) } else { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { goto raise_neg_overflow; } return (int) val; } } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); } } break; } #endif #if CYTHON_COMPILING_IN_CPYTHON if (unlikely(Py_SIZE(x) < 0)) { goto raise_neg_overflow; } #else { int result = PyObject_RichCompareBool(x, Py_False, Py_LT); if (unlikely(result < 0)) return (int) -1; if (unlikely(result == 1)) goto raise_neg_overflow; } #endif if (sizeof(int) <= sizeof(unsigned long)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) #endif } } else { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)x)->ob_digit; switch (Py_SIZE(x)) { case 0: return (int) 0; case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) case -2: if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 2: if (8 * sizeof(int) > 1 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -3: if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 3: if (8 * sizeof(int) > 2 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case -4: if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; case 4: if (8 * sizeof(int) > 3 * PyLong_SHIFT) { if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); } } break; } #endif if (sizeof(int) <= sizeof(long)) { __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) #ifdef HAVE_LONG_LONG } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) #endif } } { #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_IntOrLong(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_IntOrLong(x); if (!tmp) return (int) -1; val = __Pyx_PyInt_As_int(tmp); Py_DECREF(tmp); return val; } raise_overflow: PyErr_SetString(PyExc_OverflowError, "value too large to convert to int"); return (int) -1; raise_neg_overflow: PyErr_SetString(PyExc_OverflowError, "can't convert negative value to int"); return (int) -1; } /* FastTypeChecks */ #if CYTHON_COMPILING_IN_CPYTHON static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { while (a) { a = a->tp_base; if (a == b) return 1; } return b == &PyBaseObject_Type; } static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { PyObject *mro; if (a == b) return 1; mro = a->tp_mro; if (likely(mro)) { Py_ssize_t i, n; n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) return 1; } return 0; } return __Pyx_InBases(a, b); } #if PY_MAJOR_VERSION == 2 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { PyObject *exception, *value, *tb; int res; __Pyx_PyThreadState_declare __Pyx_PyThreadState_assign __Pyx_ErrFetch(&exception, &value, &tb); res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } if (!res) { res = PyObject_IsSubclass(err, exc_type2); if (unlikely(res == -1)) { PyErr_WriteUnraisable(err); res = 0; } } __Pyx_ErrRestore(exception, value, tb); return res; } #else static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; if (!res) { res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); } return res; } #endif static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) { Py_ssize_t i, n; assert(PyExceptionClass_Check(exc_type)); n = PyTuple_GET_SIZE(tuple); #if PY_MAJOR_VERSION >= 3 for (i=0; i= 0x02070000 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; } /* InitStrings */ 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 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; if (PyObject_Hash(*t->p) == -1) 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 const char* __Pyx_PyObject_AsString(PyObject* o) { Py_ssize_t ignore; return __Pyx_PyObject_AsStringAndSize(o, &ignore); } #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT #if !CYTHON_PEP393_ENABLED static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { 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 *length = PyBytes_GET_SIZE(defenc); return defenc_c; } #else static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII if (likely(PyUnicode_IS_ASCII(o))) { *length = PyUnicode_GET_LENGTH(o); return PyUnicode_AsUTF8(o); } else { PyUnicode_AsASCIIString(o); return NULL; } #else return PyUnicode_AsUTF8AndSize(o, length); #endif } #endif #endif static CYTHON_INLINE const 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)) { return __Pyx_PyUnicode_AsStringAndSize(o, length); } else #endif #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) if (PyByteArray_Check(o)) { *length = PyByteArray_GET_SIZE(o); return PyByteArray_AS_STRING(o); } else #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 int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) { int retval; if (unlikely(!x)) return -1; retval = __Pyx_PyObject_IsTrue(x); Py_DECREF(x); return retval; } static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(result)) { if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, "__int__ returned non-int (type %.200s). " "The ability to return an instance of a strict subclass of int " "is deprecated, and may be removed in a future version of Python.", Py_TYPE(result)->tp_name)) { Py_DECREF(result); return NULL; } return result; } #endif PyErr_Format(PyExc_TypeError, "__%.4s__ returned non-%.4s (type %.200s)", type_name, type_name, Py_TYPE(result)->tp_name); Py_DECREF(result); return NULL; } static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { #if CYTHON_USE_TYPE_SLOTS PyNumberMethods *m; #endif const char *name = NULL; PyObject *res = NULL; #if PY_MAJOR_VERSION < 3 if (likely(PyInt_Check(x) || PyLong_Check(x))) #else if (likely(PyLong_Check(x))) #endif return __Pyx_NewRef(x); #if CYTHON_USE_TYPE_SLOTS m = Py_TYPE(x)->tp_as_number; #if PY_MAJOR_VERSION < 3 if (m && m->nb_int) { name = "int"; res = m->nb_int(x); } else if (m && m->nb_long) { name = "long"; res = m->nb_long(x); } #else if (likely(m && m->nb_int)) { name = "int"; res = m->nb_int(x); } #endif #else if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { res = PyNumber_Int(x); } #endif if (likely(res)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { #else if (unlikely(!PyLong_CheckExact(res))) { #endif return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } 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))) { if (sizeof(Py_ssize_t) >= sizeof(long)) return PyInt_AS_LONG(b); else return PyInt_AsSsize_t(b); } #endif if (likely(PyLong_CheckExact(b))) { #if CYTHON_USE_PYLONG_INTERNALS const digit* digits = ((PyLongObject*)b)->ob_digit; const Py_ssize_t size = Py_SIZE(b); if (likely(__Pyx_sst_abs(size) <= 1)) { ival = likely(size) ? digits[0] : 0; if (size == -1) ival = -ival; return ival; } else { switch (size) { case 2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -2: if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -3: if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case 4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; case -4: if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); } break; } } #endif return PyLong_AsSsize_t(b); } x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) { return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False); } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { return PyInt_FromSize_t(ival); } #endif /* Py_PYTHON_H */ cytoolz-0.10.1/cytoolz/utils.pxd000066400000000000000000000000411355770264200166620ustar00rootroot00000000000000cpdef object consume(object seq) cytoolz-0.10.1/cytoolz/utils.pyx000066400000000000000000000025111355770264200167130ustar00rootroot00000000000000import os.path import cytoolz __all__ = ['raises', 'no_default', 'include_dirs', 'consume'] try: # Attempt to get the no_default sentinel object from toolz from toolz.utils import no_default except ImportError: no_default = '__no__default__' def raises(err, lamda): try: lamda() return False except err: return True def include_dirs(): """ Return a list of directories containing the *.pxd files for ``cytoolz`` Use this to include ``cytoolz`` in your own Cython project, which allows fast C bindinds to be imported such as ``from cytoolz cimport get``. Below is a minimal "setup.py" file using ``include_dirs``: from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext import cytoolz.utils ext_modules=[ Extension("mymodule", ["mymodule.pyx"], include_dirs=cytoolz.utils.include_dirs() ) ] setup( name = "mymodule", cmdclass = {"build_ext": build_ext}, ext_modules = ext_modules ) """ return os.path.split(cytoolz.__path__[0]) cpdef object consume(object seq): """ Efficiently consume an iterable """ for _ in seq: pass cytoolz-0.10.1/cytoolz/utils_test.py000066400000000000000000000040331355770264200175630ustar00rootroot00000000000000import doctest import inspect __all__ = ['module_doctest'] # The utilities below were obtained from: # https://github.com/cython/cython/wiki/FAQ # #how-can-i-run-doctests-in-cython-code-pyx-files # # Cython-compatible wrapper for doctest.testmod(). # # Usage example, assuming a Cython module mymod.pyx is compiled. # This is run from the command line, passing a command to Python: # python -c "import cydoctest, mymod; cydoctest.testmod(mymod)" # # (This still won't let a Cython module run its own doctests # when called with "python mymod.py", but it's pretty close. # Further options can be passed to testmod() as desired, e.g. # verbose=True.) def _from_module(module, object): """ Return true if the given object is defined in the given module. """ if module is None: return True elif inspect.getmodule(object) is not None: return module is inspect.getmodule(object) elif inspect.isfunction(object): return module.__dict__ is object.func_globals elif inspect.isclass(object): return module.__name__ == object.__module__ elif hasattr(object, '__module__'): return module.__name__ == object.__module__ elif isinstance(object, property): return True # [XX] no way not be sure. else: raise ValueError("object must be a class or function") def _fix_module_doctest(module): """ Extract docstrings from cython functions, that would be skipped by doctest otherwise. """ module.__test__ = {} for name in dir(module): value = getattr(module, name) if (inspect.isbuiltin(value) and isinstance(value.__doc__, str) and _from_module(module, value)): module.__test__[name] = value.__doc__ def module_doctest(m, *args, **kwargs): """ Fix a Cython module's doctests, then call doctest.testmod() All other arguments are passed directly to doctest.testmod(). Return True on success, False on failure. """ _fix_module_doctest(m) return doctest.testmod(m, *args, **kwargs).failed == 0 cytoolz-0.10.1/debian/000077500000000000000000000000001355770264200145315ustar00rootroot00000000000000cytoolz-0.10.1/debian/changelog000066400000000000000000000002171355770264200164030ustar00rootroot00000000000000python3-cytoolz (0.8.2-1) UNRELEASED; urgency=high * new package -- Jeff Cliff Sat, 25 Nov 2017 14:16:28 +0500 cytoolz-0.10.1/debian/compat000066400000000000000000000000021355770264200157270ustar00rootroot000000000000009 cytoolz-0.10.1/debian/control000066400000000000000000000016131355770264200161350ustar00rootroot00000000000000# ------------------------------------------------------------------------- # # DEBIAN PACKAGE CONTROL FILE # # # # This file is a Debian control file. For more information on the config in # # this file, please run `man deb-control`. # # ------------------------------------------------------------------------- # Source: python3-cytoolz Section: contrib/python Priority: extra Maintainer: Jeff Cliff Build-Depends: debhelper(>= 9), cython3, python3, dh-python, python3-nose Standards-Version: 3.9.5 Package: python3-cytoolz Architecture: any Pre-Depends: dpkg (>= 1.16.1), cython3, python3 Depends: make, python3-nose, ${shlibs:Depends} Description: Cython implementation of Toolz High performance functional utilities cytoolz-0.10.1/debian/copyright000066400000000000000000000032401355770264200164630ustar00rootroot00000000000000Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: cytoolz Source: https://github.com/pytoolz/cytoolz Files: * Copyright: 2014-2017 Erik Welch License: 3-clause BSD Copyright (c) 2014 Erik Welch All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: a. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. b. 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. c. Neither the name of cytoolz nor the names of its 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 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 REGENTS 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. cytoolz-0.10.1/debian/files000066400000000000000000000002651355770264200155610ustar00rootroot00000000000000python3-cytoolz-dbgsym_0.8.2-1_amd64.ddeb contrib/debug optional python3-cytoolz_0.8.2-1_amd64.buildinfo contrib/python extra python3-cytoolz_0.8.2-1_amd64.deb contrib/python extra cytoolz-0.10.1/debian/python3-cytoolz.substvars000066400000000000000000000003241355770264200216130ustar00rootroot00000000000000python3:Depends=python3 (<< 3.7), python3 (>= 3.6~), python3-toolz, python3:any (>= 3.3.2-2~) python3:Provides=python3.6-cytoolz python3:Versions=3.6 shlibs:Depends=libc6 (>= 2.4) misc:Depends= misc:Pre-Depends= cytoolz-0.10.1/debian/rules000077500000000000000000000001701355770264200156070ustar00rootroot00000000000000#! /usr/bin/make -f export DH_VERBOSE = 1 export PYBUILD_NAME = foo %: dh $@ --with python3 --buildsystem=pybuild cytoolz-0.10.1/requirements_devel.txt000066400000000000000000000001001355770264200177410ustar00rootroot00000000000000cython>=0.20.2 nose -e git+https://github.com/pytoolz/toolz.git cytoolz-0.10.1/setup.py000066400000000000000000000123231355770264200150220ustar00rootroot00000000000000""" Build ``cytoolz`` with or without Cython. By default, CyToolz will be built using Cython if available. If Cython is not available, then the default C compiler will be used to compile the distributed *.c files instead. Pass "--cython" or "--with-cython" as a command line argument to setup.py to force the project to build using Cython (and fail if Cython is unavailable). Pass "--no-cython" or "--without-cython" to disable usage of Cython. For convenience, developmental versions (with 'dev' in the version number) automatically use Cython unless disabled via a command line argument. To summarize differently, the rules are as follows (apply first applicable rule): 1. If `--no-cython` or `--without-cython` are used, then only build from `.*c` files. 2. If this is a dev version, then cythonize only the files that have changed. 3. If `--cython` or `--with-cython` are used, then force cythonize all files. 4. If no arguments are passed, then force cythonize all files if Cython is available, else build from `*.c` files. This is default when installing via pip. By forcing cythonization of all files (except in dev) if Cython is available, we avoid the case where the generated `*.c` files are not forward-compatible. """ import os.path import sys from setuptools import setup, Extension info = {} filename = os.path.join('cytoolz', '_version.py') exec(compile(open(filename, "rb").read().replace(b'\r\n', b'\n'), filename, 'exec'), info) VERSION = info['__version__'] try: from Cython.Build import cythonize has_cython = True except ImportError: has_cython = False use_cython = True is_dev = 'dev' in VERSION strict_cython = is_dev if '--no-cython' in sys.argv: use_cython = False sys.argv.remove('--no-cython') if '--without-cython' in sys.argv: use_cython = False sys.argv.remove('--without-cython') if '--cython' in sys.argv: strict_cython = True sys.argv.remove('--cython') if '--with-cython' in sys.argv: strict_cython = True sys.argv.remove('--with-cython') if use_cython and not has_cython: if strict_cython: raise RuntimeError('Cython required to build dev version of cytoolz.') print('ALERT: Cython not installed. Building without Cython.') use_cython = False if use_cython: suffix = '.pyx' else: suffix = '.c' ext_modules = [] for modname in ['dicttoolz', 'functoolz', 'itertoolz', 'recipes', 'utils']: ext_modules.append(Extension('cytoolz.' + modname.replace('/', '.'), ['cytoolz/' + modname + suffix])) if use_cython: try: from Cython.Compiler.Options import get_directive_defaults directive_defaults = get_directive_defaults() except ImportError: # for Cython < 0.25 from Cython.Compiler.Options import directive_defaults directive_defaults['embedsignature'] = True directive_defaults['binding'] = True directive_defaults['language_level'] = 2 # TODO: drop Python 2.7 and update this (and code) to 3 # The distributed *.c files may not be forward compatible. # If we are cythonizing a non-dev version, then force everything to cythonize. ext_modules = cythonize(ext_modules, force=not is_dev) setup( name='cytoolz', version=VERSION, description=('Cython implementation of Toolz: ' 'High performance functional utilities'), ext_modules=ext_modules, long_description=(open('README.rst').read() if os.path.exists('README.rst') else ''), url='https://github.com/pytoolz/cytoolz', author='https://raw.github.com/pytoolz/cytoolz/master/AUTHORS.md', author_email='erik.n.welch@gmail.com', maintainer='Erik Welch', maintainer_email='erik.n.welch@gmail.com', license = 'BSD', packages=['cytoolz', 'cytoolz.curried'], package_data={'cytoolz': ['*.pyx', '*.pxd', 'curried/*.pyx', 'tests/*.py']}, # include_package_data = True, keywords=('functional utility itertools functools iterator generator ' 'curry memoize lazy streaming bigdata cython toolz cytoolz'), classifiers = [ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Cython', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Topic :: Scientific/Engineering', 'Topic :: Scientific/Engineering :: Information Analysis', 'Topic :: Software Development', 'Topic :: Software Development :: Libraries', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Utilities', ], install_requires=['toolz >= 0.8.0'], extras_require={'cython': ['cython']}, zip_safe=False, )